5 "@(#)eltorito.c 1.52 15/11/23 joerg";
42#define MIN(a, b) (((a) < (b))? (a): (b))
79 comerrno(
EX_BAD,
_(
"Missing boot image name, use -eltorito-boot option.\n"));
86 add_sort_match(
p, sort_matches(
p, 1));
192 s_entry->sort = this_dir->sort;
197 s_entry->sort = sort_matches(
bootcat_path, s_entry->sort);
257 unsigned char *checksum_ptr;
270 memset(boot_desc, 0,
sizeof (*boot_desc));
271 boot_desc->
type[0] = 0;
339 offset +=
sizeof (boot_desc_record)) {
352 _(
"Too many El Torito boot entries\n"));
360 if (last_section_header)
367 sizeof (boot_shdr_record));
368 offset +=
sizeof (boot_desc_record);
379 sizeof (boot_desc_record));
382 if (last_section_header) {
410 if (!boot_desc_entry || !boot_entry)
420 memset(boot_desc_entry, 0,
sizeof (*boot_desc_entry));
437 _(
"Size of boot image is %d sectors -> "), nsectors);
449 comerr(
_(
"Error opening boot image '%s' for read.\n"),
454 comerr(
_(
"Error reading MBR from boot image '%s'.\n"),
460 _(
"Warning: boot image '%s' MBR is not a boot sector.\n"),
478 _(
"Boot image '%s' has multiple partitions.\n"),
489 _(
"Warning: partition not marked active.\n"));
495 _(
"Warning: partition does not start at 0/1/1.\n"));
500 if (geosec != nsectors) {
502 _(
"Warning: image size does not match geometry (%d)\n"),
519 _(
"Boot image '%s' has no partitions.\n"),
540 if (nsectors == 2880) {
545 }
else if (nsectors == 5760) {
550 }
else if (nsectors == 2400) {
557 _(
"Error - boot image '%s' has not an allowable size.\n"),
571 set_721(boot_desc_entry->
nsect, (
unsigned int) nsectors);
579 unsigned int bi_checksum;
580 unsigned int total_len;
586 if (bootimage == -1) {
588 _(
"Error opening boot image file '%s' for update.\n"),
597 _(
"Odd alignment at non-end-of-file in boot image '%s'.\n"),
601 memset(csum_buffer, 0, 64 - total_len);
605 bi_checksum +=
get_731(&csum_buffer[
i]);
609 if (total_len != de->
size) {
611 _(
"Boot image file '%s' changed underneath us!\n"),
616 memset(&bi_table, 0,
sizeof (bi_table));
623 write(bootimage, &bi_table,
sizeof (bi_table));
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
EXPORT void comerrno(int err, char *msg, va_alist)
EXPORT int errmsgno(int err, char *msg, va_alist)
EXPORT void comerr(char *msg, va_alist)
static cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
LOCAL struct eltorito_validation_entry valid_desc
EXPORT void ex_boot_enoent(char *msg, char *pname)
LOCAL int tvd_write(FILE *outfile)
EXPORT void insert_boot_cat()
EXPORT void init_boot_catalog(char *path) const
LOCAL unsigned int bcat_de_flags
static UConst char sccsid[]
LOCAL struct disk_master_boot_record disk_mbr
LOCAL char * bootcat_path
LOCAL struct eltorito_boot_descriptor gboot_desc
struct output_fragment torito_desc
EXPORT int new_boot_entry()
LOCAL void fill_boot_desc(struct eltorito_defaultboot_entry *boot_desc_entry, struct eltorito_boot_entry_info *boot_entry)
LOCAL void fill_boot_shdr(struct eltorito_sectionheader_entry *boot_shdr_entry, int arch)
LOCAL void get_torito_desc(struct eltorito_boot_descriptor *boot_desc)
EXPORT void get_boot_entry()
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define la_to_u_2_byte(a)
#define EL_TORITO_MEDIA_NOEMUL
#define EL_TORITO_NOT_BOOTABLE
#define EL_TORITO_MEDIA_HD
#define EL_TORITO_MEDIA_12FLOP
#define EL_TORITO_BOOTABLE
#define EL_TORITO_ARCH_x86
#define EL_TORITO_SHDR_ID_SHDR
#define EL_TORITO_MEDIA_144FLOP
#define EL_TORITO_MEDIA_288FLOP
#define EL_TORITO_SHDR_ID_LAST_SHDR
EXPORT void set_723(void *vp, UInt32_t i)
EXPORT void set_731(void *vp, UInt32_t i)
EXPORT void set_721(void *vp, UInt32_t i)
EXPORT UInt32_t get_733(void *vp)
EXPORT UInt32_t get_731(void *vp)
EXPORT void set_733(void *vp, UInt32_t i)
EXPORT int iso9660_date(char *result, time_t crtime)
int volume_sequence_number
struct eltorito_boot_entry_info * current_boot_entry
struct eltorito_boot_entry_info * first_boot_entry
EXPORT void * e_malloc(size_t size)
struct eltorito_boot_entry_info * last_boot_entry
EXPORT char * e_strdup(char *s) const
#define memcpy(s1, s2, n)
#define INHIBIT_JOLIET_ENTRY
#define INHIBIT_UDF_ENTRY
UInt32_t last_extent_written
#define ELTORITO_SECTION_HEADER
#define INHIBIT_ISO9660_ENTRY
#define sprintf(buf, format,...)
EXPORT int generate_xa_rr_attributes(char *whole_name, char *name, struct directory_entry *s_entry, struct stat *statbuf, struct stat *lstatbuf, int deep_opt)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
unsigned int starting_block
struct directory_entry * next
struct iso_directory_record isorec
struct directory * filedir
struct directory_entry * contents
char version[ISODCL(7, 7)]
char system_id[ISODCL(8, 39)]
char bootcat_ptr[ISODCL(72, 75)]
struct eltorito_boot_entry_info * next
char boot_id[ISODCL(1, 1)]
char boot_media[ISODCL(2, 2)]
char loadseg[ISODCL(3, 4)]
char bootoff[ISODCL(9, 12)]
char sys_type[ISODCL(5, 5)]
char bi_csum[ISODCL(13, 16)]
char bi_pvd[ISODCL(1, 4)]
char bi_length[ISODCL(9, 12)]
char bi_file[ISODCL(5, 8)]
static HRESULT add_match(IMatchCollection2 *iface, IMatch2 *add)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList