Skip to content

Commit

Permalink
corrected construction of '..' directory entry
Browse files Browse the repository at this point in the history
  • Loading branch information
gozora committed Oct 25, 2015
1 parent eedcdd4 commit ec23ff1
Show file tree
Hide file tree
Showing 10 changed files with 243 additions and 112 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# ebiso
UEFI bootable ISO image creator

Primary intention of ebiso was to create simple bootable UEFI ISO image for [ReaR](https://github.com/rear/rear) on SLES11. It should however work on other Linux based platforms as well.
Primary intention of ebiso was to create simple bootable UEFI ISO image for [ReaR](https://github.com/rear/rear) on SLES11. It should however work on other Linux based distributions as well.

- no additional dependencies
- released under GPL
- supports 8.3 file name and RRIP (Rock Ridge Interchange Protocol)
- supports 8.3 and long file names (up to 255 characters) formats
- more info can be found in [ebiso wiki](https://github.com/gozora/ebiso/wiki)
- tested with rear on SLES11 SP3 and Centos 6.7
- basic [usage](https://github.com/gozora/ebiso/wiki/Usage)
Expand Down
22 changes: 14 additions & 8 deletions ebiso.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* ebiso.c
*
* Version: 0.1.3
* Version: 0.1.4
*
* Release date: 21.10.2015
* Release date: 25.10.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand Down Expand Up @@ -129,6 +129,7 @@ int main(int argc, char *argv[]) {
list->dir_id = 1;
list->parent_id = 1;
list->next = (struct file_list_t*) malloc(sizeof(struct file_list_t));
ISO_data.dir_count = 1;
rr_list = list->next;
memset(rr_list, 0, sizeof(struct file_list_t));

Expand Down Expand Up @@ -162,7 +163,7 @@ int main(int argc, char *argv[]) {
}

/* Create initial file structure */
if ((rv = list_create(ISO_data.work_dir, &rr_list)) != E_OK)
if ((rv = list_create(ISO_data.work_dir, &rr_list, &ISO_data)) != E_OK)
goto cleanup;

/* Remove possible duplicates */
Expand Down Expand Up @@ -233,11 +234,16 @@ int main(int argc, char *argv[]) {
cleanup:

list_clean(list);
free(terminator);
free(path_table_LSB);
free(path_table_MSB);
free(header);
free(boot_descriptor);
if (terminator != NULL)
free(terminator);
if (path_table_LSB != NULL)
free(path_table_LSB);
if (path_table_MSB != NULL)
free(path_table_MSB);
if (header != NULL)
free(header);
if (boot_descriptor != NULL)
free(boot_descriptor);

return rv;
}
Expand Down
8 changes: 4 additions & 4 deletions include/ebiso.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* ebiso.h
*
* Version: 0.1.3
* Version: 0.1.4
*
* Release date: 21.10.2015
* Release date: 25.10.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand Down Expand Up @@ -33,7 +33,7 @@
#include <getopt.h>

#define PROGNAME "ebiso"
#define VERSION "0.1.3"
#define VERSION "0.1.4"

#ifdef DEBUG
static void disp_level(struct file_list_t *list_to_display, int level);
Expand All @@ -57,7 +57,7 @@ enum msg_l {

extern void filename_rename_duplicates(struct file_list_t *list);

extern int list_create(const char *dirname, struct file_list_t **flist);
extern int list_create(const char *dirname, struct file_list_t **flist, struct ISO_data_t *ISO_data);
extern void list_clean(struct file_list_t *list_to_clean);

extern uint32_t iso9660_header(void **header, struct file_list_t file_list, struct ISO_data_t ISO_data);
Expand Down
7 changes: 4 additions & 3 deletions include/globals.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* globals.h
*
* Version: 0.4.0
* Version: 0.4.1
*
* Release date: 20.10.2015
* Release date: 25.10.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand Down Expand Up @@ -44,8 +44,9 @@
#define PT_RECORD_LEN 0x8
#define ARR_PREALLOC 20
#define RRIP_INIT_FIELDS rrip_RR | rrip_PX | rrip_TF | rrip_NM
//#define RRIP_INIT_FIELDS rrip_RR | rrip_PX | rrip_TF
//#define RRIP_INIT_FIELDS rrip_RR
//#define RRIP_INIT_FIELDS rrip_NM
//#define RRIP_INIT_FIELDS rrip_TF | rrip_PX

#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)

Expand Down
19 changes: 15 additions & 4 deletions include/iso9660.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* iso9660.h
*
* Version: 0.2.0
* Version: 0.2.1
*
* Release date: 20.10.2015
* Release date: 25.10.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand Down Expand Up @@ -47,9 +47,19 @@ enum rrip_fields_t {
rrip_NM = 1 << 4
} rrip_fields_t;

struct iso9660_data_t {
char mdate_time[7];
uint64_t LBA;
uint64_t data_len;
uint32_t volume_seq_number;
uint8_t flags;
uint8_t name_len;
uint8_t ext_attr_record;
} iso9660_data_t;

extern int option_on_off(uint32_t option2check, enum opt_l option);
extern int write_files(struct file_list_t *file_list, FILE *dest);
extern struct file_list_t *list_search(struct file_list_t *file_list, char *needle);
extern struct file_list_t *list_search_name(struct file_list_t *file_list, char *needle);
extern int CE_assign_LBA(struct CE_list_t *CE_list, struct file_list_t *file_list, uint32_t *LBA);
extern int CEarr_init_list(struct CE_list_t *CE_list, int arr_prealloc);
extern void CEarr_destroy_list(struct CE_list_t *CE_list);
Expand All @@ -65,7 +75,8 @@ uint8_t do_pad(uint8_t len, enum pad_list_t type);
/* el_torito.c */
void iso9660_cp2heap(void **dest, const void *source, long int size, uint32_t *dest_size);

static uint32_t construct_dir_record(struct file_list_t *file_list, void **directory_table_output, enum segment_list_t type);
static uint32_t construct_dir_record(struct file_list_t *file_list, struct file_list_t **parent_index, void **directory_table_output, enum segment_list_t type);
static int construct_iso9660_record(void **output, struct iso9660_data_t data, uint32_t *size);
static uint64_t get_int32_LSB_MSB(uint64_t input);
static uint32_t get_int16_LSB_MSB(uint32_t input);
static int blocks_count(int size);
Expand Down
9 changes: 4 additions & 5 deletions include/list.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* list.h
*
* Version: 0.1.1
* Version: 0.1.2
*
* Release date: 20.09.2015
* Release date: 25.09.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand All @@ -30,9 +30,8 @@
extern uint8_t filename_convert_name(char *input, char *output, enum conv_type_l type);

/* ebiso.c */
int list_create(const char *dirname, struct file_list_t **flist);
int list_create(const char *dirname, struct file_list_t **flist, struct ISO_data_t *ISO_data);
void list_clean(struct file_list_t *list_to_clean);

/* iso9660.c */
struct file_list_t *list_search(struct file_list_t *file_list, char *needle);

struct file_list_t *list_search_name(struct file_list_t *file_list, char *needle);
Loading

0 comments on commit ec23ff1

Please sign in to comment.