#if-less grub-mkimage
This commit is contained in:
parent
7576adef7c
commit
614be3f119
9 changed files with 765 additions and 685 deletions
|
@ -19,6 +19,9 @@
|
|||
#ifndef GRUB_BOOT_MACHINE_HEADER
|
||||
#define GRUB_BOOT_MACHINE_HEADER 1
|
||||
|
||||
#define MACHINE I386_PC
|
||||
#include <grub/offsets.h>
|
||||
|
||||
/* The signature for bootloader. */
|
||||
#define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55
|
||||
|
||||
|
@ -57,9 +60,6 @@
|
|||
floppy. */
|
||||
#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. */
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4)
|
||||
|
||||
|
@ -68,16 +68,7 @@
|
|||
|
||||
#define GRUB_BOOT_MACHINE_PXE_DL 0x7f
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
/* This is the blocklist used in the diskboot image. */
|
||||
struct grub_boot_blocklist
|
||||
{
|
||||
grub_uint64_t start;
|
||||
grub_uint16_t len;
|
||||
grub_uint16_t segment;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
#define grub_boot_blocklist grub_pc_bios_boot_blocklist
|
||||
|
||||
#endif /* ! BOOT_MACHINE_HEADER */
|
||||
|
|
|
@ -19,29 +19,9 @@
|
|||
#ifndef KERNEL_MACHINE_HEADER
|
||||
#define KERNEL_MACHINE_HEADER 1
|
||||
|
||||
/* The offset of GRUB_TOTAL_MODULE_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE 0x8
|
||||
#define MACHINE I386_PC
|
||||
|
||||
/* 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_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)
|
||||
#include <grub/offsets.h>
|
||||
|
||||
/* Enable LZMA compression */
|
||||
#define ENABLE_LZMA 1
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
|
||||
#include <grub/i386/memory.h>
|
||||
|
||||
#define MACHINE I386_PC
|
||||
#include <grub/offsets.h>
|
||||
|
||||
/* The scratch buffer used in real mode code. */
|
||||
#define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000
|
||||
#define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4)
|
||||
|
@ -40,9 +43,6 @@
|
|||
/* The size of the protect mode stack. */
|
||||
#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. */
|
||||
#define GRUB_MEMORY_MACHINE_PROT_STACK \
|
||||
(GRUB_MEMORY_MACHINE_SCRATCH_ADDR + GRUB_MEMORY_MACHINE_SCRATCH_SIZE \
|
||||
|
|
|
@ -22,7 +22,4 @@
|
|||
/* 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
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
#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
|
||||
|
||||
|
|
|
@ -50,10 +50,6 @@
|
|||
#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 0x4400
|
||||
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200
|
||||
|
||||
#endif /* ! BOOT_MACHINE_HEADER */
|
||||
|
|
|
@ -42,21 +42,8 @@
|
|||
#define GRUB_KERNEL_MACHINE_RAW_SIZE 0
|
||||
#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
|
||||
|
||||
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/types.h>
|
||||
|
||||
|
|
1378
util/grub-mkimage.c
1378
util/grub-mkimage.c
File diff suppressed because it is too large
Load diff
|
@ -171,7 +171,7 @@ fi
|
|||
if test -e "${pc_dir}" ; then
|
||||
echo "Enabling BIOS support ..."
|
||||
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
|
||||
cat ${pc_dir}/cdboot.img ${core_img} > ${iso9660_dir}/boot/grub/i386-pc/eltorito.img
|
||||
|
||||
|
|
Loading…
Reference in a new issue