#if-less grub-mkimage

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-26 00:45:21 +02:00
parent 7576adef7c
commit 614be3f119
9 changed files with 765 additions and 685 deletions

View file

@ -19,6 +19,9 @@
#ifndef GRUB_BOOT_MACHINE_HEADER #ifndef GRUB_BOOT_MACHINE_HEADER
#define GRUB_BOOT_MACHINE_HEADER 1 #define GRUB_BOOT_MACHINE_HEADER 1
#define MACHINE I386_PC
#include <grub/offsets.h>
/* The signature for bootloader. */ /* The signature for bootloader. */
#define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55 #define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55
@ -57,9 +60,6 @@
floppy. */ floppy. */
#define GRUB_BOOT_MACHINE_BIOS_HD_FLAG 0x80 #define GRUB_BOOT_MACHINE_BIOS_HD_FLAG 0x80
/* The segment where the kernel is loaded. */
#define GRUB_BOOT_MACHINE_KERNEL_SEG 0x800
/* The address where the kernel is loaded. */ /* The address where the kernel is loaded. */
#define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4) #define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4)
@ -68,16 +68,7 @@
#define GRUB_BOOT_MACHINE_PXE_DL 0x7f #define GRUB_BOOT_MACHINE_PXE_DL 0x7f
#ifndef ASM_FILE
/* This is the blocklist used in the diskboot image. */ /* This is the blocklist used in the diskboot image. */
struct grub_boot_blocklist #define grub_boot_blocklist grub_pc_bios_boot_blocklist
{
grub_uint64_t start;
grub_uint16_t len;
grub_uint16_t segment;
} __attribute__ ((packed));
#endif /* ! ASM_FILE */
#endif /* ! BOOT_MACHINE_HEADER */ #endif /* ! BOOT_MACHINE_HEADER */

View file

@ -19,29 +19,9 @@
#ifndef KERNEL_MACHINE_HEADER #ifndef KERNEL_MACHINE_HEADER
#define KERNEL_MACHINE_HEADER 1 #define KERNEL_MACHINE_HEADER 1
/* The offset of GRUB_TOTAL_MODULE_SIZE. */ #define MACHINE I386_PC
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE 0x8
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */ #include <grub/offsets.h>
#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_INSTALL_DOS_PART. */
#define GRUB_KERNEL_MACHINE_INSTALL_DOS_PART 0x14
/* The offset of GRUB_INSTALL_BSD_PART. */
#define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART 0x18
/* The offset of GRUB_PREFIX. */
#define GRUB_KERNEL_MACHINE_PREFIX 0x1c
/* End of the data section. */
#define GRUB_KERNEL_MACHINE_DATA_END 0x5c
/* The size of the first region which won't be compressed. */
#define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x5F0)
/* Enable LZMA compression */ /* Enable LZMA compression */
#define ENABLE_LZMA 1 #define ENABLE_LZMA 1

View file

@ -29,6 +29,9 @@
#include <grub/i386/memory.h> #include <grub/i386/memory.h>
#define MACHINE I386_PC
#include <grub/offsets.h>
/* The scratch buffer used in real mode code. */ /* The scratch buffer used in real mode code. */
#define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000 #define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000
#define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4) #define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4)
@ -40,9 +43,6 @@
/* The size of the protect mode stack. */ /* The size of the protect mode stack. */
#define GRUB_MEMORY_MACHINE_PROT_STACK_SIZE 0x8000 #define GRUB_MEMORY_MACHINE_PROT_STACK_SIZE 0x8000
/* The upper memory area (starting at 640 kiB). */
#define GRUB_MEMORY_MACHINE_UPPER 0xa0000
/* The protected mode stack. */ /* The protected mode stack. */
#define GRUB_MEMORY_MACHINE_PROT_STACK \ #define GRUB_MEMORY_MACHINE_PROT_STACK \
(GRUB_MEMORY_MACHINE_SCRATCH_ADDR + GRUB_MEMORY_MACHINE_SCRATCH_SIZE \ (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + GRUB_MEMORY_MACHINE_SCRATCH_SIZE \

View file

@ -22,7 +22,4 @@
/* The size of boot.img. */ /* The size of boot.img. */
#define GRUB_BOOT_MACHINE_SIZE (0x100000 - GRUB_BOOT_MACHINE_LINK_ADDR) #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 #endif

View file

@ -19,9 +19,6 @@
#ifndef GRUB_KERNEL_MACHINE_HEADER #ifndef GRUB_KERNEL_MACHINE_HEADER
#define GRUB_KERNEL_MACHINE_HEADER 1 #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. */ /* The offset of GRUB_KERNEL_IMAGE_SIZE. */
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc #define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc

View file

@ -50,10 +50,6 @@
#define GRUB_BOOT_MACHINE_CODE_END \ #define GRUB_BOOT_MACHINE_CODE_END \
(0x1fc - GRUB_BOOT_AOUT_HEADER_SIZE) (0x1fc - GRUB_BOOT_AOUT_HEADER_SIZE)
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x4400
#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200 #define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200
#endif /* ! BOOT_MACHINE_HEADER */ #endif /* ! BOOT_MACHINE_HEADER */

View file

@ -42,21 +42,8 @@
#define GRUB_KERNEL_MACHINE_RAW_SIZE 0 #define GRUB_KERNEL_MACHINE_RAW_SIZE 0
#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000 #define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000
#define GRUB_PLATFORM_IMAGE_FORMATS "raw, aout"
#define GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT "raw"
#define GRUB_PLATFORM_IMAGE_DEFAULT GRUB_PLATFORM_IMAGE_RAW
#ifndef ASM_FILE #ifndef ASM_FILE
typedef enum {
GRUB_PLATFORM_IMAGE_RAW,
GRUB_PLATFORM_IMAGE_AOUT
}
grub_platform_image_format_t;
#define GRUB_PLATFORM_IMAGE_RAW GRUB_PLATFORM_IMAGE_RAW
#define GRUB_PLATFORM_IMAGE_AOUT GRUB_PLATFORM_IMAGE_AOUT
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/types.h> #include <grub/types.h>

File diff suppressed because it is too large Load diff

View file

@ -171,7 +171,7 @@ fi
if test -e "${pc_dir}" ; then if test -e "${pc_dir}" ; then
echo "Enabling BIOS support ..." echo "Enabling BIOS support ..."
core_img=`mktemp "$MKTEMP_TEMPLATE"` core_img=`mktemp "$MKTEMP_TEMPLATE"`
grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \ grub-mkimage -d ${pc_dir}/ -O i386-pc -o ${core_img} --prefix=/boot/grub/i386-pc \
iso9660 biosdisk iso9660 biosdisk
cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img