View | Details | Raw Unified | Return to bug 5796
Collapse All | Expand All

(-)lilo-22.4.1.orig/activate.c (+1 lines)
Lines 3-8 Link Here
3
/* Copyright 1992-1995 Werner Almesberger. See file COPYING for details. */
3
/* Copyright 1992-1995 Werner Almesberger. See file COPYING for details. */
4
4
5
5
6
#define _GNU_SOURCE
6
#include <stdlib.h>
7
#include <stdlib.h>
7
#include <stdio.h>
8
#include <stdio.h>
8
#include <stdarg.h>
9
#include <stdarg.h>
(-)lilo-22.4.1.orig/bitmap.h (-2 / +2 lines)
Lines 12-19 Link Here
12
#ifndef BITMAP_H
12
#ifndef BITMAP_H
13
#define BITMAP_H
13
#define BITMAP_H
14
14
15
typedef unsigned long  bm_uint32;
15
typedef unsigned int  bm_uint32;
16
typedef signed long    bm_sint32;
16
typedef signed int    bm_sint32;
17
typedef unsigned short bm_uint16;
17
typedef unsigned short bm_uint16;
18
typedef signed short   bm_sint16;
18
typedef signed short   bm_sint16;
19
typedef unsigned char  bm_byte;
19
typedef unsigned char  bm_byte;
(-)lilo-22.4.1.orig/boot.c (-4 / +5 lines)
Lines 10-15 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <stdlib.h>
14
#include <stdlib.h>
14
#include <stdio.h>
15
#include <stdio.h>
15
#include <unistd.h>
16
#include <unistd.h>
Lines 77-83 Link Here
77
	check_size(spec,setup,sectors);
78
	check_size(spec,setup,sectors);
78
    else {
79
    else {
79
	if (hdr.start % PAGE_SIZE)
80
	if (hdr.start % PAGE_SIZE)
80
	    die("Can't load kernel at mis-aligned address 0x%08lx\n",hdr.start);
81
	    die("Can't load kernel at mis-aligned address 0x%08x\n",hdr.start);
81
#if 0
82
#if 0
82
	descr->start_page = hdr.start/PAGE_SIZE; /* load kernel high */
83
	descr->start_page = hdr.start/PAGE_SIZE; /* load kernel high */
83
#endif
84
#endif
Lines 97-103 Link Here
97
	fd = geo_open(&geo,initrd,O_RDONLY);
98
	fd = geo_open(&geo,initrd,O_RDONLY);
98
	if (fstat(fd,&st) < 0) die("fstat %s: %s",initrd,strerror(errno));
99
	if (fstat(fd,&st) < 0) die("fstat %s: %s",initrd,strerror(errno));
99
#if 1
100
#if 1
100
	*(unsigned long *) descr->rd_size = st.st_size;
101
	*(unsigned int *) descr->rd_size = st.st_size;
101
#else
102
#else
102
	descr->rd_size = (st.st_size + SECTOR_SIZE - 1)/SECTOR_SIZE;
103
	descr->rd_size = (st.st_size + SECTOR_SIZE - 1)/SECTOR_SIZE;
103
#endif
104
#endif
Lines 325-331 Link Here
325
	if (fstat(b_fd,&st) < 0)
326
	if (fstat(b_fd,&st) < 0)
326
	    die("fstat %s: %s",boot,strerror(errno));
327
	    die("fstat %s: %s",boot,strerror(errno));
327
	if (!geo.file) part_verify(st.st_rdev,0);
328
	if (!geo.file) part_verify(st.st_rdev,0);
328
	if (lseek(b_fd,(long) BOOT_SIG_OFFSET,SEEK_SET) < 0)
329
	if (lseek(b_fd,(int) BOOT_SIG_OFFSET,SEEK_SET) < 0)
329
	    die("lseek %s: %s",boot,strerror(errno));
330
	    die("lseek %s: %s",boot,strerror(errno));
330
	if ((size = read(b_fd, (char *)&magic, 2)) != 2) {
331
	if ((size = read(b_fd, (char *)&magic, 2)) != 2) {
331
	    if (size < 0) die("read %s: %s",boot,strerror(errno));
332
	    if (size < 0) die("read %s: %s",boot,strerror(errno));
Lines 357-363 Link Here
357
    else {
358
    else {
358
	if ((p_fd = open(part,O_RDONLY)) < 0)
359
	if ((p_fd = open(part,O_RDONLY)) < 0)
359
	    die("open %s: %s",part,strerror(errno));
360
	    die("open %s: %s",part,strerror(errno));
360
	if (lseek(p_fd,(long) PART_TABLE_OFFSET,0) < 0)
361
	if (lseek(p_fd,(int) PART_TABLE_OFFSET,0) < 0)
361
	    die("lseek %s: %s",part,strerror(errno));
362
	    die("lseek %s: %s",part,strerror(errno));
362
	if (read(p_fd,(char *) buff[0].par_c.ptable,PART_TABLE_SIZE) !=
363
	if (read(p_fd,(char *) buff[0].par_c.ptable,PART_TABLE_SIZE) !=
363
	  PART_TABLE_SIZE)
364
	  PART_TABLE_SIZE)
(-)lilo-22.4.1.orig/bsect.c (-20 / +21 lines)
Lines 10-22 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <unistd.h>
14
#include <unistd.h>
14
#include <sys/types.h>
15
#include <sys/types.h>
15
#include <sys/statfs.h>
16
#include <sys/stat.h>
16
#include <sys/stat.h>
17
#include <stdio.h>
17
#include <stdio.h>
18
#include <fcntl.h>
18
#include <fcntl.h>
19
#include <errno.h>
19
#include <errno.h>
20
#include <dirent.h>
20
21
21
#ifdef	_SYS_STATFS_H
22
#ifdef	_SYS_STATFS_H
22
#define	_I386_STATFS_H	/* two versions of statfs is not good ... */
23
#define	_I386_STATFS_H	/* two versions of statfs is not good ... */
Lines 73-79 Link Here
73
static char *getval_user;
74
static char *getval_user;
74
75
75
typedef struct Pass {
76
typedef struct Pass {
76
    long crc[MAX_PW_CRC];
77
    int crc[MAX_PW_CRC];
77
    char *unique;
78
    char *unique;
78
    char *label;
79
    char *label;
79
    struct Pass *next;
80
    struct Pass *next;
Lines 254-260 Link Here
254
    
256
    
255
	for (walk=pwsave; walk; walk=walk->next) {
257
	for (walk=pwsave; walk; walk=walk->next) {
256
	    fprintf(pw_file, "label=<\"%s\">", walk->label);
258
	    fprintf(pw_file, "label=<\"%s\">", walk->label);
257
	    for (i=0; i<MAX_PW_CRC; i++) fprintf(pw_file, " 0x%08lX", walk->crc[i]);
259
	    for (i=0; i<MAX_PW_CRC; i++) fprintf(pw_file, " 0x%08X", walk->crc[i]);
258
	    fprintf(pw_file, "\n");
260
	    fprintf(pw_file, "\n");
259
	}
261
	}
260
    }
262
    }
Lines 295-306 Link Here
295
    if (verbose >=5) printf("end pw_fill_cache\n");
297
    if (verbose >=5) printf("end pw_fill_cache\n");
296
}
298
}
297
299
298
static void hash_password(char *password, long crcval[])
300
static void hash_password(char *password, int crcval[])
299
{
301
{
300
#ifdef CRC_PASSWORDS
302
#ifdef CRC_PASSWORDS
301
   static long poly[] = {CRC_POLY1, CRC_POLY2, CRC_POLY3, CRC_POLY4, CRC_POLY5};
303
   static int poly[] = {CRC_POLY1, CRC_POLY2, CRC_POLY3, CRC_POLY4, CRC_POLY5};
302
#endif
304
#endif
303
	long crc;
305
	int crc;
304
	int j;
306
	int j;
305
	int i = strlen(password);
307
	int i = strlen(password);
306
	
308
	
Lines 320-326 Link Here
320
#endif
322
#endif
321
	    if(verbose >= 2) {
323
	    if(verbose >= 2) {
322
		if (j==0) printf("Password " PWTYPE " =");
324
		if (j==0) printf("Password " PWTYPE " =");
323
		printf(" %08lX", crc);
325
		printf(" %08X", crc);
324
	    }
326
	    }
325
	}
327
	}
326
	if (verbose >= 2) printf("\n");
328
	if (verbose >= 2) printf("\n");
Lines 364-370 Link Here
364
}
366
}
365
#endif
367
#endif
366
368
367
static void pw_get(char *pass, long crcval[], int option)
369
static void pw_get(char *pass, int crcval[], int option)
368
{
370
{
369
    PASSWORD *walk;
371
    PASSWORD *walk;
370
    char *pass2;
372
    char *pass2;
Lines 379-385 Link Here
379
    for (walk=pwsave; walk; walk=walk->next) {
381
    for (walk=pwsave; walk; walk=walk->next) {
380
        if (pass == walk->unique ||
382
        if (pass == walk->unique ||
381
        	(!walk->unique && !strcmp(walk->label,label) && (walk->unique=pass)) ) {
383
        	(!walk->unique && !strcmp(walk->label,label) && (walk->unique=pass)) ) {
382
            memcpy(crcval, walk->crc, MAX_PW_CRC*sizeof(long));
384
            memcpy(crcval, walk->crc, MAX_PW_CRC*sizeof(int));
383
            return;
385
            return;
384
        }
386
        }
385
    }
387
    }
Lines 407-417 Link Here
407
    pw_wipe(pass2);  
409
    pw_wipe(pass2);  
408
    hash_password(pass, walk->crc);
410
    hash_password(pass, walk->crc);
409
    pw_wipe(pass);
411
    pw_wipe(pass);
410
    memcpy(crcval, walk->crc, MAX_PW_CRC*sizeof(long));
412
    memcpy(crcval, walk->crc, MAX_PW_CRC*sizeof(int));
411
}
413
}
412
414
413
415
414
static void retrieve_crc(long crcval[])
416
static void retrieve_crc(int crcval[])
415
{
417
{
416
    int i;
418
    int i;
417
    char *pass;
419
    char *pass;
Lines 425-431 Link Here
425
427
426
    if (verbose >= 1) {
428
    if (verbose >= 1) {
427
        printf("Password found is");
429
        printf("Password found is");
428
        for (i=0; i<MAX_PW_CRC; i++) printf(" %08lX", crcval[i]);
430
        for (i=0; i<MAX_PW_CRC; i++) printf(" %08X", crcval[i]);
429
        printf("\n");
431
        printf("\n");
430
    }
432
    }
431
}
433
}
Lines 486-492 Link Here
486
    /* order of color attributes is:
488
    /* order of color attributes is:
487
          text, hilighted text, border, title
489
          text, hilighted text, border, title
488
    */
490
    */
489
#define color(c) ((int)strchr(khar,(int)(c))-(int)khar)
491
#define color(c) ((int)(strchr(khar,(int)(c))-khar))
490
    bg = 0;
492
    bg = 0;
491
    at = &(menu->at_text);
493
    at = &(menu->at_text);
492
    for (i=0; i<4 && *scheme; i++) {
494
    for (i=0; i<4 && *scheme; i++) {
Lines 529-535 Link Here
529
531
530
532
531
void bsect_open(char *boot_dev,char *map_file,char *install,int delay,
533
void bsect_open(char *boot_dev,char *map_file,char *install,int delay,
532
  int timeout, long raid_offset)
534
  int timeout, int raid_offset)
533
{
535
{
534
    static char coms[] = "0123";
536
    static char coms[] = "0123";
535
    static char parity[] = "NnOoEe";
537
    static char parity[] = "NnOoEe";
Lines 546-552 Link Here
546
    BITMAPFILEHEADER fhv;
548
    BITMAPFILEHEADER fhv;
547
    BITMAPHEADER bmhv;
549
    BITMAPHEADER bmhv;
548
    BITMAPLILOHEADER lhv;
550
    BITMAPLILOHEADER lhv;
549
    unsigned long timestamp;
551
    unsigned int timestamp;
550
#ifdef LCF_BUILTIN
552
#ifdef LCF_BUILTIN
551
    BUILTIN_FILE *loader;
553
    BUILTIN_FILE *loader;
552
#else
554
#else
Lines 1054-1062 Link Here
1054
        ( (password = cfg_get_strg(cf_options,"password")) &&
1056
        ( (password = cfg_get_strg(cf_options,"password")) &&
1055
          !cfg_get_flag(cf_all,"bypass")  ) ) {
1057
          !cfg_get_flag(cf_all,"bypass")  ) ) {
1056
	if (!*password) {	/* null password triggers interaction */
1058
	if (!*password) {	/* null password triggers interaction */
1057
	    retrieve_crc((long*)descr->password_crc);
1059
	    retrieve_crc((int*)descr->password_crc);
1058
	} else {
1060
	} else {
1059
	    hash_password(password, (long*)descr->password_crc );
1061
	    hash_password(password, (int*)descr->password_crc );
1060
	}
1062
	}
1061
	descr->flags |= FLAG_PASSWORD;
1063
	descr->flags |= FLAG_PASSWORD;
1062
    }
1064
    }
Lines 1110-1116 Link Here
1110
    }
1112
    }
1111
#if 0
1113
#if 0
1112
#if 1
1114
#if 1
1113
    *(unsigned long *) descr->rd_size = 0; /* no RAM disk */
1115
    *(unsigned int *) descr->rd_size = 0; /* no RAM disk */
1114
#else
1116
#else
1115
    descr->rd_size = 0; /* no RAM disk */
1117
    descr->rd_size = 0; /* no RAM disk */
1116
#endif
1118
#endif
Lines 1235-1241 Link Here
1235
/*	map_descrs(&descrs, bsect.par_1.descr, &bsect.par_1.dflcmd);  */
1237
/*	map_descrs(&descrs, bsect.par_1.descr, &bsect.par_1.dflcmd);  */
1236
	map_descrs(&descrs, menu->mt_descr, &bsect.par_1.dflcmd);
1238
	map_descrs(&descrs, menu->mt_descr, &bsect.par_1.dflcmd);
1237
1239
1238
	((long*)table)[SECTOR_SIZE/sizeof(long)-2] = crc32(table, SECTOR_SIZE-2*sizeof(long), CRC_POLY1);
1240
	((int*)table)[SECTOR_SIZE/sizeof(int)-2] = crc32(table, SECTOR_SIZE-2*sizeof(int), CRC_POLY1);
1239
	map_begin_section();
1241
	map_begin_section();
1240
	map_add_sector(table);
1242
	map_add_sector(table);
1241
	(void) map_write(&bsect.par_1.keytab,1,0);
1243
	(void) map_write(&bsect.par_1.keytab,1,0);
Lines 1435-1441 Link Here
1435
}
1437
}
1436
1438
1437
1439
1438
void bsect_raid_update(char *boot_dev, unsigned long raid_offset, 
1440
void bsect_raid_update(char *boot_dev, unsigned int raid_offset, 
1439
	char *backup_file, int force_backup, int pass)
1441
	char *backup_file, int force_backup, int pass)
1440
{
1442
{
1441
    BOOT_SECTOR bsect_save;
1443
    BOOT_SECTOR bsect_save;
(-)lilo-22.4.1.orig/bsect.h (-2 / +2 lines)
Lines 29-35 Link Here
29
/* Read the boot sector stored on BOOT_DEV into BUFFER. */
29
/* Read the boot sector stored on BOOT_DEV into BUFFER. */
30
30
31
void bsect_open(char *boot_dev,char *map_file,char *install,int delay,
31
void bsect_open(char *boot_dev,char *map_file,char *install,int delay,
32
  int timeout, long raid_offset);
32
  int timeout, int raid_offset);
33
33
34
/* Loads the boot sector of the specified device and merges it with a new
34
/* Loads the boot sector of the specified device and merges it with a new
35
   boot sector (if install != NULL). Sets the boot delay to 'delay' 1/10 sec.
35
   boot sector (if install != NULL). Sets the boot delay to 'delay' 1/10 sec.
Lines 48-54 Link Here
48
48
49
/* Updates the boot sector and the map file. */
49
/* Updates the boot sector and the map file. */
50
50
51
void bsect_raid_update(char *boot_dev, unsigned long raid_offset, 
51
void bsect_raid_update(char *boot_dev, unsigned int raid_offset, 
52
	char *backup_file, int force_backup, int pass);
52
	char *backup_file, int force_backup, int pass);
53
53
54
/* Update the boot sector and the map file, with RAID considerations */
54
/* Update the boot sector and the map file, with RAID considerations */
(-)lilo-22.4.1.orig/cfg.c (+1 lines)
Lines 10-15 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <sys/stat.h>
14
#include <sys/stat.h>
14
#include <unistd.h>
15
#include <unistd.h>
15
#include <stdlib.h>
16
#include <stdlib.h>
(-)lilo-22.4.1.orig/common.c (-3 / +4 lines)
Lines 10-15 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <unistd.h>
14
#include <unistd.h>
14
#include <stdlib.h>
15
#include <stdlib.h>
15
#include <stdio.h>
16
#include <stdio.h>
Lines 27-33 Link Here
27
28
28
unsigned short drv_map[DRVMAP_SIZE+1]; /* fixup maps ... */
29
unsigned short drv_map[DRVMAP_SIZE+1]; /* fixup maps ... */
29
int curr_drv_map;
30
int curr_drv_map;
30
unsigned long prt_map[PRTMAP_SIZE+1];
31
unsigned int prt_map[PRTMAP_SIZE+1];
31
int curr_prt_map;
32
int curr_prt_map;
32
#if 0
33
#if 0
33
unsigned long crc_polynomial[MAX_PW_CRC] = { 
34
unsigned long crc_polynomial[MAX_PW_CRC] = { 
Lines 138-146 Link Here
138
139
139
/* calculate a CRC-32 polynomial */
140
/* calculate a CRC-32 polynomial */
140
141
141
unsigned long crc32 (unsigned char *cp, int nsize, unsigned long polynomial)
142
unsigned int crc32 (unsigned char *cp, int nsize, unsigned int polynomial)
142
{
143
{
143
   unsigned long poly, crc;
144
   unsigned int poly, crc;
144
   int i;
145
   int i;
145
   unsigned char ch;
146
   unsigned char ch;
146
147
(-)lilo-22.4.1.orig/common.h (-12 / +12 lines)
Lines 48-54 Link Here
48
							block	0
48
							block	0
49
;*/    char name[MAX_IMAGE_NAME+1];	/* image name, NUL terminated 
49
;*/    char name[MAX_IMAGE_NAME+1];	/* image name, NUL terminated 
50
						id_name:	.blkb	MAX_IMAGE_NAME_asm+1
50
						id_name:	.blkb	MAX_IMAGE_NAME_asm+1
51
;*/    unsigned short password_crc[MAX_PW_CRC*(sizeof(long)/sizeof(short))];  /* 4 password CRC-32 values
51
;*/    unsigned short password_crc[MAX_PW_CRC*(sizeof(int)/sizeof(short))];  /* 4 password CRC-32 values
52
						id_password_crc:.blkb	MAX_PW_CRC_asm*4
52
						id_password_crc:.blkb	MAX_PW_CRC_asm*4
53
;*/    unsigned short rd_size[2]; /* RAM disk size in sectors, 0 if none
53
;*/    unsigned short rd_size[2]; /* RAM disk size in sectors, 0 if none
54
						id_rd_size:	.blkb	4		;don't change the order !!!
54
						id_rd_size:	.blkb	4		;don't change the order !!!
Lines 81-89 Link Here
81
;*/    unsigned char ser_param; /* RS-232 parameters, must be 0 if unused
81
;*/    unsigned char ser_param; /* RS-232 parameters, must be 0 if unused
82
						par1_port:	.blkb	1	; referenced together
82
						par1_port:	.blkb	1	; referenced together
83
						par1_ser_param:	.blkb	1	; **
83
						par1_ser_param:	.blkb	1	; **
84
;*/    unsigned long raid_offset; /* raid partition/partition offset
84
;*/    unsigned int raid_offset; /* raid partition/partition offset
85
						par1_raid_offset: .blkb	4
85
						par1_raid_offset: .blkb	4
86
;*/    unsigned long timestamp; /* timestamp for restoration
86
;*/    unsigned int timestamp; /* timestamp for restoration
87
						par1_timestamp:	.blkb	4
87
						par1_timestamp:	.blkb	4
88
;*/    unsigned short timeout; /* 54 msec delay until input time-out,
88
;*/    unsigned short timeout; /* 54 msec delay until input time-out,
89
			       0xffff: never 
89
			       0xffff: never 
Lines 221-228 Link Here
221
    } d;
221
    } d;
222
    unsigned char sector[SECTOR_SIZE*MAX_DESCR_SECS];
222
    unsigned char sector[SECTOR_SIZE*MAX_DESCR_SECS];
223
    struct {
223
    struct {
224
    	unsigned long sector[SECTOR_SIZE/4*MAX_DESCR_SECS - 1];
224
    	unsigned int sector[SECTOR_SIZE/4*MAX_DESCR_SECS - 1];
225
    	unsigned long checksum;
225
    	unsigned int checksum;
226
    } l;
226
    } l;
227
} DESCR_SECTORS;
227
} DESCR_SECTORS;
228
228
Lines 246-259 Link Here
246
    unsigned char loader;	/* 16: loader type */
246
    unsigned char loader;	/* 16: loader type */
247
    unsigned char flags;	/* 17: loader flags */
247
    unsigned char flags;	/* 17: loader flags */
248
    unsigned short a;		/* 18: more LOADLIN hacks */
248
    unsigned short a;		/* 18: more LOADLIN hacks */
249
    unsigned long start;	/* 20: kernel start, filled in by loader */
249
    unsigned int start;		/* 20: kernel start, filled in by loader */
250
    unsigned long ramdisk;	/* 24: RAM disk start address */
250
    unsigned int ramdisk;	/* 24: RAM disk start address */
251
    unsigned long ramdisk_size;	/* 28: RAM disk size */
251
    unsigned int ramdisk_size;	/* 28: RAM disk size */
252
    unsigned short b,c;		/* 32: bzImage hacks */
252
    unsigned short b,c;		/* 32: bzImage hacks */
253
    unsigned short heap_end_ptr;/* 36: 2.01 end of free area after setup code */
253
    unsigned short heap_end_ptr;/* 36: 2.01 end of free area after setup code */
254
    unsigned char d;		/* 38: padding */
254
    unsigned char d;		/* 38: padding */
255
    unsigned long cmd_line_ptr; /* 40: 2.02 address32 of command line */
255
    unsigned int cmd_line_ptr; /* 40: 2.02 address32 of command line */
256
    unsigned long ramdisk_max;	/* 44: 2.03 address32 of highest mem. for ramdisk */
256
    unsigned int ramdisk_max;	/* 44: 2.03 address32 of highest mem. for ramdisk */
257
} SETUP_HDR;
257
} SETUP_HDR;
258
258
259
#define alloc_t(t) ((t *) alloc(sizeof(t)))
259
#define alloc_t(t) ((t *) alloc(sizeof(t)))
Lines 266-272 Link Here
266
extern int boot_dev_nr,raid_flags,do_md_install,zflag,eflag;
266
extern int boot_dev_nr,raid_flags,do_md_install,zflag,eflag;
267
extern unsigned short drv_map[DRVMAP_SIZE+1]; /* needed for fixup maps */
267
extern unsigned short drv_map[DRVMAP_SIZE+1]; /* needed for fixup maps */
268
extern int curr_drv_map;
268
extern int curr_drv_map;
269
extern unsigned long prt_map[PRTMAP_SIZE+1];
269
extern unsigned int prt_map[PRTMAP_SIZE+1];
270
extern int curr_prt_map, config_read;
270
extern int curr_prt_map, config_read;
271
#if 0
271
#if 0
272
extern unsigned long crc_polynomial[MAX_PW_CRC];
272
extern unsigned long crc_polynomial[MAX_PW_CRC];
Lines 308-314 Link Here
308
   the same file, zero if they don't. */
308
   the same file, zero if they don't. */
309
309
310
310
311
unsigned long crc32 (unsigned char *cp, int nsize, unsigned long polynomial);
311
unsigned int crc32 (unsigned char *cp, int nsize, unsigned int polynomial);
312
/* calculate a CRC-32 polynomial */
312
/* calculate a CRC-32 polynomial */
313
313
314
314
(-)lilo-22.4.1.orig/edit.c (-6 / +6 lines)
Lines 104-110 Link Here
104
	n = bmh->numBitPlanes = bmh2.numBitPlanes;
105
	n = bmh->numBitPlanes = bmh2.numBitPlanes;
105
	n *= bmh->numBitsPerPlane = bmh2.numBitsPerPlane;
106
	n *= bmh->numBitsPerPlane = bmh2.numBitsPerPlane;
106
	bmh->numColorsUsed = bmh->numImportantColors = 1 << n;
107
	bmh->numColorsUsed = bmh->numImportantColors = 1 << n;
107
	bmh->sizeImageData = *(long*)(fh->size) - *(long*)(fh->offsetToBits);
108
	bmh->sizeImageData = *(int*)(fh->size) - *(int*)(fh->offsetToBits);
108
	bmh->size = sizeof(*bmh);    /* new size!! */
109
	bmh->size = sizeof(*bmh);    /* new size!! */
109
	n = sizeof(RGB2);
110
	n = sizeof(RGB2);
110
    }
111
    }
Lines 123-129 Link Here
123
	if (read(fd, &palette[i], n) != n)  return -1;
124
	if (read(fd, &palette[i], n) != n)  return -1;
124
	if (n==sizeof(RGB2)) palette[i].null = 0;
125
	if (n==sizeof(RGB2)) palette[i].null = 0;
125
    } 
126
    } 
126
    if (*(long*)(fh->offsetToBits) == sizeof(BITMAPFILEHEADER) +
127
    if (*(int*)(fh->offsetToBits) == sizeof(BITMAPFILEHEADER) +
127
    		sizeof(BITMAPHEADER) + sizeof(BITMAPLILOHEADER) +
128
    		sizeof(BITMAPHEADER) + sizeof(BITMAPLILOHEADER) +
128
    		npal*sizeof(RGB) )  /* test will fail for OS/2 bitmaps */ {
129
    		npal*sizeof(RGB) )  /* test will fail for OS/2 bitmaps */ {
129
      /* get probable BITMAPLILOHEADER */
130
      /* get probable BITMAPLILOHEADER */
Lines 131-137 Link Here
131
	if (size != sizeof(BITMAPLILOHEADER))   return 4;
132
	if (size != sizeof(BITMAPLILOHEADER))   return 4;
132
	if (read(fd, (void*)lh+sizeof(size), sizeof(*lh)-sizeof(size)) !=
133
	if (read(fd, (void*)lh+sizeof(size), sizeof(*lh)-sizeof(size)) !=
133
		sizeof(*lh)-sizeof(size))  return -1;
134
		sizeof(*lh)-sizeof(size))  return -1;
134
	*(long*)(lh->size) = size;
135
	*(int*)(lh->size) = size;
135
	if (strncmp(lh->magic, "LILO", 4) != 0)   return 5;
136
	if (strncmp(lh->magic, "LILO", 4) != 0)   return 5;
136
    } else { /* there is no BITMAPLILOHEADER present */
137
    } else { /* there is no BITMAPLILOHEADER present */
137
#ifdef STANDALONE
138
#ifdef STANDALONE
Lines 169-178 Link Here
169
	else if (n<0)  printf("Error reading input\n");
170
	else if (n<0)  printf("Error reading input\n");
170
    } while (n>0);
171
    } while (n>0);
171
    bmh->sizeImageData = total;
172
    bmh->sizeImageData = total;
172
    *(long*)(fh->offsetToBits) = n = sizeof(BITMAPFILEHEADER) +
173
    *(int*)(fh->offsetToBits) = n = sizeof(BITMAPFILEHEADER) +
173
    		sizeof(BITMAPHEADER) + sizeof(BITMAPLILOHEADER) +
174
    		sizeof(BITMAPHEADER) + sizeof(BITMAPLILOHEADER) +
174
    		npalette*sizeof(RGB);
175
    		npalette*sizeof(RGB);
175
    *(long*)(fh->size) = total + n;
176
    *(int*)(fh->size) = total + n;
176
    lseek(fd, 0, SEEK_SET);
177
    lseek(fd, 0, SEEK_SET);
177
    write(fd, fh, sizeof(*fh));
178
    write(fd, fh, sizeof(*fh));
178
    write(fd, bmh, sizeof(*bmh));
179
    write(fd, bmh, sizeof(*bmh));
Lines 191-197 Link Here
191
	} tm;
192
	} tm;
192
static	MENUTABLE *menu = &tm.mt;
193
static	MENUTABLE *menu = &tm.mt;
193
static	BITMAPLILOHEADER *lh = (void*)tm.buffer + 
194
static	BITMAPLILOHEADER *lh = (void*)tm.buffer + 
194
    			((int)&tm.mt.row - (int)&tm.bmlh.row);
195
    			((long)&tm.mt.row - (long)&tm.bmlh.row);
195
196
196
/* a convenience definition */
197
/* a convenience definition */
197
#define mn tm.mt
198
#define mn tm.mt
(-)lilo-22.4.1.orig/geometry.c (-1 lines)
Lines 17-23 Link Here
17
#include <sys/types.h>
17
#include <sys/types.h>
18
18
19
#ifdef LCF_REISERFS
19
#ifdef LCF_REISERFS
20
#include <sys/statfs.h>
21
20
22
#ifdef	_SYS_STATFS_H
21
#ifdef	_SYS_STATFS_H
23
#define	_I386_STATFS_H	/* two versions of statfs is not good ... */
22
#define	_I386_STATFS_H	/* two versions of statfs is not good ... */
(-)lilo-22.4.1.orig/identify.c (+1 lines)
Lines 11-16 Link Here
11
*/
11
*/
12
12
13
13
14
#define _GNU_SOURCE
14
#include <stdlib.h>
15
#include <stdlib.h>
15
#include <unistd.h>
16
#include <unistd.h>
16
#include <stdio.h>
17
#include <stdio.h>
(-)lilo-22.4.1.orig/lilo.c (-23 / +25 lines)
Lines 10-15 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <stdlib.h>
14
#include <stdlib.h>
14
#include <unistd.h>
15
#include <unistd.h>
15
#include <stdio.h>
16
#include <stdio.h>
Lines 18-23 Link Here
18
#include <fcntl.h>
19
#include <fcntl.h>
19
#include <errno.h>
20
#include <errno.h>
20
#include <sys/stat.h>
21
#include <sys/stat.h>
22
#include <dirent.h>
21
23
22
#include <asm/page.h>
24
#include <asm/page.h>
23
25
Lines 42-48 Link Here
42
static md_array_info_t md_array_info;
44
static md_array_info_t md_array_info;
43
static DT_ENTRY *md_disk;
45
static DT_ENTRY *md_disk;
44
static DT_ENTRY *disk;
46
static DT_ENTRY *disk;
45
static unsigned long raid_base, raid_offset[MAX_RAID];
47
static unsigned int raid_base, raid_offset[MAX_RAID];
46
static char *raid_mbr[MAX_RAID];
48
static char *raid_mbr[MAX_RAID];
47
static int raid_device[MAX_RAID+1];
49
static int raid_device[MAX_RAID+1];
48
static int raid_bios[MAX_RAID+1];
50
static int raid_bios[MAX_RAID+1];
Lines 179-185 Link Here
179
	    	index = lowest;
181
	    	index = lowest;
180
	    }
182
	    }
181
183
182
	    if (verbose>=2) printf("Specifed partition:  %s  raid offset = %08lX\n",
184
	    if (verbose>=2) printf("Specifed partition:  %s  raid offset = %08X\n",
183
					raid_list[pass], raid_offset[index]);
185
					raid_list[pass], raid_offset[index]);
184
186
185
	    if (!test) {
187
	    if (!test) {
Lines 219-225 Link Here
219
}
221
}
220
222
221
223
222
static long raid_setup(void)
224
static int raid_setup(void)
223
{
225
{
224
    int pass, mask;
226
    int pass, mask;
225
    struct stat st;
227
    struct stat st;
Lines 228-234 Link Here
228
    GEOMETRY geo;
230
    GEOMETRY geo;
229
    char *boot, *extrap;
231
    char *boot, *extrap;
230
    int ro_set, all_pri_eq, pri_index;
232
    int ro_set, all_pri_eq, pri_index;
231
    long pri_offset;
233
    int pri_offset;
232
    int raid_limit;
234
    int raid_limit;
233
    
235
    
234
    if ((boot=cfg_get_strg(cf_options,"boot")) != NULL &&
236
    if ((boot=cfg_get_strg(cf_options,"boot")) != NULL &&
Lines 360-367 Link Here
360
	    disktab = disk;
362
	    disktab = disk;
361
363
362
	    if (verbose >= 2 && do_md_install) {
364
	    if (verbose >= 2 && do_md_install) {
363
		printf("disk->start = %d\t\traid_offset = %ld (%08lX)\n",
365
		printf("disk->start = %d\t\traid_offset = %d (%08X)\n",
364
		   disk->start, (long)raid_offset[ndisk], (long)raid_offset[ndisk]);
366
		   disk->start, (int)raid_offset[ndisk], (int)raid_offset[ndisk]);
365
	    }
367
	    }
366
   	
368
   	
367
	/* derive the MBR name, which may be needed later */
369
	/* derive the MBR name, which may be needed later */
Lines 709-718 Link Here
709
		    else printf("    Kernel is loaded \"high\"\n");
711
		    else printf("    Kernel is loaded \"high\"\n");
710
#endif
712
#endif
711
#if 1
713
#if 1
712
		    if (!*(unsigned long *) descrs.d.descr[image].rd_size)
714
		    if (!*(unsigned int *) descrs.d.descr[image].rd_size)
713
			printf("    No initial RAM disk\n");
715
			printf("    No initial RAM disk\n");
714
		    else printf("    Initial RAM disk is %ld bytes\n",
716
		    else printf("    Initial RAM disk is %d bytes\n",
715
			  *(unsigned long *) descrs.d.descr[image].rd_size);
717
			  *(unsigned int *) descrs.d.descr[image].rd_size);
716
#else
718
#else
717
		    if (!descrs.d.descr[image].rd_size)
719
		    if (!descrs.d.descr[image].rd_size)
718
			printf("    No initial RAM disk\n");
720
			printf("    No initial RAM disk\n");
Lines 808-814 Link Here
808
    int query,more,version,uninstall,validate,activate,instmbr,geom;
810
    int query,more,version,uninstall,validate,activate,instmbr,geom;
809
    struct stat st;
811
    struct stat st;
810
    int fd;
812
    int fd;
811
    long raid_offset;
813
    int raid_offset;
812
814
813
    errstd = stderr;
815
    errstd = stderr;
814
    config_file = DFL_CONFIG;
816
    config_file = DFL_CONFIG;
Lines 1004-1011 Link Here
1004
		"-DCODE_START_1=%d -DCODE_START_2=%d "
1006
		"-DCODE_START_1=%d -DCODE_START_2=%d "
1005
		  "\n"
1007
		  "\n"
1006
		  ,
1008
		  ,
1007
		  sizeof(BOOT_PARAMS_1),
1009
		  (int)sizeof(BOOT_PARAMS_1),
1008
		  sizeof(BOOT_PARAMS_2)
1010
		  (int)sizeof(BOOT_PARAMS_2)
1009
		     );
1011
		     );
1010
#if 1
1012
#if 1
1011
{
1013
{
Lines 1014-1030 Link Here
1014
	RGB2 pal2[16];
1016
	RGB2 pal2[16];
1015
	
1017
	
1016
	printf("\nBMFH=%d BMH=%d BMH2=%d RGB=%d(%d) RGB2=%d(%d) LH=%d\n",
1018
	printf("\nBMFH=%d BMH=%d BMH2=%d RGB=%d(%d) RGB2=%d(%d) LH=%d\n",
1017
	sizeof(BITMAPFILEHEADER),
1019
	(int)sizeof(BITMAPFILEHEADER),
1018
	sizeof(BITMAPHEADER),
1020
	(int)sizeof(BITMAPHEADER),
1019
	sizeof(BITMAPHEADER2),
1021
	(int)sizeof(BITMAPHEADER2),
1020
	sizeof(RGB),
1022
	(int)sizeof(RGB),
1021
	sizeof(pal),
1023
	(int)sizeof(pal),
1022
	sizeof(RGB2),
1024
	(int)sizeof(RGB2),
1023
	sizeof(pal2),
1025
	(int)sizeof(pal2),
1024
	sizeof(BITMAPLILOHEADER) );
1026
	(int)sizeof(BITMAPLILOHEADER) );
1025
	printf("\nBPB=%d BP_DOS=%d\n",
1027
	printf("\nBPB=%d BP_DOS=%d\n",
1026
		sizeof(BIOS_PARAMETER_BLOCK),
1028
		(int)sizeof(BIOS_PARAMETER_BLOCK),
1027
		sizeof(BOOT_PARAMS_DOS)
1029
		(int)sizeof(BOOT_PARAMS_DOS)
1028
		  );
1030
		  );
1029
}
1031
}
1030
#endif
1032
#endif
Lines 1113-1119 Link Here
1113
/* test for a RAID installation */
1115
/* test for a RAID installation */
1114
    raid_offset = raid_setup();
1116
    raid_offset = raid_setup();
1115
    if (verbose >= 2)
1117
    if (verbose >= 2)
1116
        printf("raid_setup returns offset = %08lX  ndisk = %d\n", raid_offset, ndisk);
1118
        printf("raid_setup returns offset = %08X  ndisk = %d\n", raid_offset, ndisk);
1117
	    
1119
	    
1118
	if (uninstall)
1120
	if (uninstall)
1119
	    bsect_uninstall(uninst_dev ? uninst_dev : cfg_get_strg(cf_options,
1121
	    bsect_uninstall(uninst_dev ? uninst_dev : cfg_get_strg(cf_options,
(-)lilo-22.4.1.orig/lilo.h (-1 / +1 lines)
Lines 105-111 Link Here
105
#if MAX_DESCR_SECS > MAX_DESCR_SECTORS
105
#if MAX_DESCR_SECS > MAX_DESCR_SECTORS
106
# error "Maximum DSECS=x exceeded."
106
# error "Maximum DSECS=x exceeded."
107
#endif
107
#endif
108
#define MAX_IMAGES      ((SECTOR_SIZE*MAX_DESCR_SECS-sizeof(long)-1)/sizeof(IMAGE_DESCR))
108
#define MAX_IMAGES      ((int)(SECTOR_SIZE*MAX_DESCR_SECS-sizeof(int)-1)/sizeof(IMAGE_DESCR))
109
			  /* maximum number of images */
109
			  /* maximum number of images */
110
110
111
#define SECTOR_SIZE	512 /* disk sector size */
111
#define SECTOR_SIZE	512 /* disk sector size */
(-)lilo-22.4.1.orig/map.c (-1 / +2 lines)
Lines 10-15 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <unistd.h>
14
#include <unistd.h>
14
#include <stdlib.h>
15
#include <stdlib.h>
15
#include <stdio.h>
16
#include <stdio.h>
Lines 142-148 Link Here
142
143
143
    if (verbose >= 2) {
144
    if (verbose >= 2) {
144
	if (fstat(map_file,&st) < 0) pdie("fstat map file");
145
	if (fstat(map_file,&st) < 0) pdie("fstat map file");
145
	printf("Map file size: %ld bytes.\n",(long) st.st_size);
146
	printf("Map file size: %ld bytes.\n",(int) st.st_size);
146
    }
147
    }
147
    if (last!=lseek(map_file, last, SEEK_SET)) pdie("lseek map file to end");
148
    if (last!=lseek(map_file, last, SEEK_SET)) pdie("lseek map file to end");
148
}
149
}
(-)lilo-22.4.1.orig/partition.c (-18 / +25 lines)
Lines 10-17 Link Here
10
*/
10
*/
11
11
12
12
13
#define _GNU_SOURCE
13
#include <stdlib.h>
14
#include <stdlib.h>
14
#include <unistd.h>
15
#include <stdio.h>
15
#include <stdio.h>
16
#include <string.h>
16
#include <string.h>
17
#include <ctype.h>
17
#include <ctype.h>
Lines 22-29 Link Here
22
#include <linux/unistd.h>
22
#include <linux/unistd.h>
23
#include <limits.h>
23
#include <limits.h>
24
#define	_LINUX_STRING_H_
24
#define	_LINUX_STRING_H_
25
#include <linux/fs.h>
26
#include <time.h>
25
#include <time.h>
26
#include <dirent.h>
27
#include "config.h"
27
#include "config.h"
28
#include "lilo.h"
28
#include "lilo.h"
29
#include "common.h"
29
#include "common.h"
Lines 34-57 Link Here
34
#include "boot.h"
34
#include "boot.h"
35
#include "loader.h"
35
#include "loader.h"
36
36
37
37
#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 1
38
#if defined(_syscall5) && defined(__NR__llseek)
38
       
39
       
39
       _syscall5(int,  _llseek,  uint,  fd, ulong, hi, ulong, lo,
40
       _syscall5(int,  _llseek,  uint,  fd, uint, hi, uint, lo,
40
       loff_t *, res, uint, wh);
41
       lloff_t *, res, uint, wh);
41
42
42
       int _llseek(unsigned int fd,  unsigned  long  offset_high,
43
       int _llseek(unsigned int fd,  unsigned  int  offset_high,
43
       unsigned  long  offset_low,  loff_t * result, unsigned int
44
       unsigned  int  offset_low,  lloff_t * result, unsigned int
44
       whence);
45
       whence);
45
       
46
       
46
       loff_t llseek(unsigned int fd, loff_t offs, unsigned int whence)
47
       loff_t lseek64(unsigned int fd, lloff_t offs, unsigned int whence)
47
       { loff_t res;
48
       { lloff_t res;
48
       	return _llseek(fd, offs>>32, offs, &res, whence) < 0  ?
49
       	return _llseek(fd, offs>>32, offs, &res, whence) < 0  ?
49
       			 (loff_t)(-1) : res;
50
       			 (lloff_t)(-1) : res;
50
       }
51
       }
51
52
52
53
#else
53
54
/* last ditch attempt on small disks, and very old systems */
54
55
# warning "*****************************************"
56
# warning "***** no 64 bit lseek is available ******"
57
# warning "***** using 23 bit sector addresses *****"
58
# warning "*****************************************"
59
# define lseek64 lseek
60
#endif
61
#endif
55
62
56
/* identify partitions which would be destroyed if the boot block
63
/* identify partitions which would be destroyed if the boot block
57
   is overwritten:
64
   is overwritten:
Lines 90-96 Link Here
90
				) ret=1;
97
				) ret=1;
91
    
98
    
92
/* check for SWAP -- last check, as 'bs' is overwritten */
99
/* check for SWAP -- last check, as 'bs' is overwritten */
93
    else if (*(long*)bs.sector == 0xFFFFFFFEUL) {
100
    else if (*(int*)bs.sector == 0xFFFFFFFEU) {
94
	if (lseek(fd, (PAGE_SIZE)-SECTOR_SIZE, SEEK_SET) != (PAGE_SIZE)-SECTOR_SIZE)
101
	if (lseek(fd, (PAGE_SIZE)-SECTOR_SIZE, SEEK_SET) != (PAGE_SIZE)-SECTOR_SIZE)
95
	    pdie("part_nowrite lseek:");
102
	    pdie("part_nowrite lseek:");
96
	if (SECTOR_SIZE != read(fd, bs.sector, sizeof(bs)) ) pdie("part_nowrite swap check:");
103
	if (SECTOR_SIZE != read(fd, bs.sector, sizeof(bs)) ) pdie("part_nowrite swap check:");
Lines 119-125 Link Here
119
    DEVICE dev;
126
    DEVICE dev;
120
    char backup_file[PATH_MAX+1];
127
    char backup_file[PATH_MAX+1];
121
    int fd, bck_file, part, size, lin_3d, cyl;
128
    int fd, bck_file, part, size, lin_3d, cyl;
122
    unsigned long second, base;
129
    unsigned int second, base;
123
    struct partition part_table[PART_MAX];
130
    struct partition part_table[PART_MAX];
124
    int mask, i, pe, Linux, dos;
131
    int mask, i, pe, Linux, dos;
125
    unsigned short boot_sig;
132
    unsigned short boot_sig;
Lines 153-160 Link Here
153
    }
160
    }
154
    i=5;
161
    i=5;
155
    while (i<=pe && base) {
162
    while (i<=pe && base) {
156
        if (llseek(fd, LLSECTORSIZE*(base+second) + PART_TABLE_OFFSET, SEEK_SET) < 0)
163
        if (lseek64(fd, LLSECTORSIZE*(base+second) + PART_TABLE_OFFSET, SEEK_SET) < 0)
157
            die("secondary llseek failed");
164
            die("secondary lseek64 failed");
158
	if (read(fd, part_table, sizeof(part_table)) != sizeof(part_table)) die("secondary read pt failed");
165
	if (read(fd, part_table, sizeof(part_table)) != sizeof(part_table)) die("secondary read pt failed");
159
	if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig)  ||
166
	if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig)  ||
160
	    boot_sig != BOOT_SIGNATURE ) die("read second boot signature failed");
167
	    boot_sig != BOOT_SIGNATURE ) die("read second boot signature failed");
Lines 262-268 Link Here
262
static unsigned char cvt_byte(const char *s)
269
static unsigned char cvt_byte(const char *s)
263
{
270
{
264
    char *end;
271
    char *end;
265
    unsigned long value;
272
    unsigned int value;
266
273
267
    value = strtoul(s,&end,0);
274
    value = strtoul(s,&end,0);
268
    if (value > 255 || *end) cfg_error("\"%s\" is not a byte value",s);
275
    if (value > 255 || *end) cfg_error("\"%s\" is not a byte value",s);
(-)lilo-22.4.1.orig/partition.h (-2 / +6 lines)
Lines 16-26 Link Here
16
enum {PTW_OKAY=0, PTW_DOS=1, PTW_OS2=2, PTW_SWAP, PTW_XFS,
16
enum {PTW_OKAY=0, PTW_DOS=1, PTW_OS2=2, PTW_SWAP, PTW_XFS,
17
		PTW_mask=7, PTW_NTFS=8};
17
		PTW_mask=7, PTW_NTFS=8};
18
18
19
#if 1
20
19
21
#define LLSECTORSIZE ((long long)SECTOR_SIZE)
20
#define LLSECTORSIZE ((long long)SECTOR_SIZE)
22
21
23
       loff_t llseek(unsigned int fd, loff_t offs, unsigned int whence);
22
#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 1
23
typedef long long lloff_t;
24
25
#ifdef _syscall5
26
       lloff_t lseek64(unsigned int fd, lloff_t offs, unsigned int whence);
27
#endif
24
28
25
#endif
29
#endif
26
30
(-)lilo-22.4.1.orig/probe.c (-6 / +7 lines)
Lines 11-16 Link Here
11
/*#define DEBUG*/
11
/*#define DEBUG*/
12
#define VIDEO 1
12
#define VIDEO 1
13
13
14
#define _GNU_SOURCE
14
#include <stdlib.h>
15
#include <stdlib.h>
15
#include <unistd.h>
16
#include <unistd.h>
16
#include <stdio.h>
17
#include <stdio.h>
Lines 185-191 Link Here
185
        buf.s.version > (short)(PROBE_VERSION)) return 3;
186
        buf.s.version > (short)(PROBE_VERSION)) return 3;
186
    got = buf.s.length;
187
    got = buf.s.length;
187
    if (got > sizeof(buf.b) || got < sizeof(buf.s)) return 4;
188
    if (got > sizeof(buf.b) || got < sizeof(buf.s)) return 4;
188
    if (*(long*)buf.s.checksum != crc32((char*)&buf.s + 4, got-4, CRC_POLY1))
189
    if (*(int*)buf.s.checksum != crc32((char*)&buf.s + 4, got-4, CRC_POLY1))
189
    	return 5;
190
    	return 5;
190
    buf_valid = 1;
191
    buf_valid = 1;
191
    
192
    
Lines 555-562 Link Here
555
    }
555
    }
556
    i=5;
556
    i=5;
557
    while (verbose>0 && base) {
557
    while (verbose>0 && base) {
558
        if (llseek(fd, LLSECTORSIZE*(base+second) + PART_TABLE_OFFSET, SEEK_SET) < 0)
558
        if (lseek64(fd, LLSECTORSIZE*(base+second) + PART_TABLE_OFFSET, SEEK_SET) < 0)
559
            die("secondary llseek failed");
559
            die("secondary lseek64 failed");
560
	if (read(fd, pt, sizeof(pt)) != sizeof(pt)) die("secondary read pt failed");
560
	if (read(fd, pt, sizeof(pt)) != sizeof(pt)) die("secondary read pt failed");
561
	if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig)  ||
561
	if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig)  ||
562
	    boot_sig != BOOT_SIGNATURE ) die("read second boot signature failed");
562
	    boot_sig != BOOT_SIGNATURE ) die("read second boot signature failed");
Lines 844-851 Link Here
844
    while (--bios >= 0x80) {
844
    while (--bios >= 0x80) {
845
	get_geom(bios, &bdata);
845
	get_geom(bios, &bdata);
846
	if (verbose>=4) {
846
	if (verbose>=4) {
847
		printf("bios_dev: (0x%02X)  S/N=%08X  *PT=%08X\n",
847
		printf("bios_dev: (0x%02X)  S/N=%08X  *PT=%08lX\n",
848
			bios, bdata.serial_no, (int)bdata.pt);
848
			bios, bdata.serial_no, (long)bdata.pt);
849
#ifdef DEBUG
849
#ifdef DEBUG
850
		dump_pt((void*)bdata.pt);
850
		dump_pt((void*)bdata.pt);
851
#endif
851
#endif
Lines 864-870 Link Here
864
	get_geom(bios1, &bdata);
865
	get_geom(bios1, &bdata);
865
	if (  (geo->sectors && geo->sectors!=bdata.n_sect)  ||
866
	if (  (geo->sectors && geo->sectors!=bdata.n_sect)  ||
866
	       (geo->heads && geo->heads!=bdata.n_head)  )  {
867
	       (geo->heads && geo->heads!=bdata.n_head)  )  {
867
	    unsigned long nblocks = geo->cylinders * geo->heads * geo->sectors;
868
	    unsigned int nblocks = geo->cylinders * geo->heads * geo->sectors;
868
869
869
	    if (!nowarn && !(warned[bios1-0x80]&2) ) {
870
	    if (!nowarn && !(warned[bios1-0x80]&2) ) {
870
		fprintf(errstd,"Warning: Kernel & BIOS return differing head/sector geometries for device 0x%02X\n", bios1);
871
		fprintf(errstd,"Warning: Kernel & BIOS return differing head/sector geometries for device 0x%02X\n", bios1);
(-)lilo-22.4.1.orig/probe.h (-8 / +8 lines)
Lines 7-13 Link Here
7
7
8
8
9
struct disk_geom {
9
struct disk_geom {
10
   unsigned long n_total_blocks;
10
   unsigned int n_total_blocks;
11
   int n_sect;
11
   int n_sect;
12
   int n_head;
12
   int n_head;
13
   int n_cyl;
13
   int n_cyl;
Lines 25-36 Link Here
25
struct disk_param {
25
struct disk_param {
26
   short size;
26
   short size;
27
   short flags;
27
   short flags;
28
   unsigned long n_cyl;
28
   unsigned int n_cyl;
29
   unsigned long n_head;
29
   unsigned int n_head;
30
   unsigned long n_sect;
30
   unsigned int n_sect;
31
   long long n_sectors;
31
   long long n_sectors;
32
   short n_byte;
32
   short n_byte;
33
   unsigned long edd_config_ptr;
33
   unsigned int edd_config_ptr;
34
};
34
};
35
#endif
35
#endif
36
36
Lines 134-142 Link Here
134
struct Edd {
134
struct Edd {
135
   unsigned short size;			/* 26 or 30 */
135
   unsigned short size;			/* 26 or 30 */
136
   unsigned short info;
136
   unsigned short info;
137
   unsigned long  cylinders;
137
   unsigned int  cylinders;
138
   unsigned long  heads;
138
   unsigned int  heads;
139
   unsigned long  sectors;
139
   unsigned int  sectors;
140
   long long      total_sectors;
140
   long long      total_sectors;
141
   unsigned short sector_size;
141
   unsigned short sector_size;
142
142
(-)lilo-22.4.1.orig/shs2.c (+1 lines)
Lines 9-14 Link Here
9
9
10
*/
10
*/
11
11
12
#define _GNU_SOURCE
12
#include <stdlib.h>
13
#include <stdlib.h>
13
#include <string.h>
14
#include <string.h>
14
15
(-)lilo-22.4.1.orig/shs2.h (-1 / +1 lines)
Lines 13-19 Link Here
13
/*  Useful typedef's & defines */
13
/*  Useful typedef's & defines */
14
14
15
typedef unsigned char BYTE;
15
typedef unsigned char BYTE;
16
typedef unsigned long LONG;
16
typedef unsigned int  LONG;
17
17
18
/*  The SHS block size and message digest sizes, in bytes */
18
/*  The SHS block size and message digest sizes, in bytes */
19
19

Return to bug 5796