diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2006-07-12 13:49:07 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2006-07-12 13:49:07 +0000 |
commit | 5a9eea5c240e96679787e8eac16a6a6dee84478e (patch) | |
tree | bbd8553c2c30a7028cb73a68e8795af07de11138 /sys-boot | |
parent | QA: Changed qt to qt3. (diff) | |
download | gentoo-2-5a9eea5c240e96679787e8eac16a6a6dee84478e.tar.gz gentoo-2-5a9eea5c240e96679787e8eac16a6a6dee84478e.tar.bz2 gentoo-2-5a9eea5c240e96679787e8eac16a6a6dee84478e.zip |
Version bump.
(Portage version: 2.1.1_pre2-r7)
Diffstat (limited to 'sys-boot')
-rw-r--r-- | sys-boot/lilo/ChangeLog | 12 | ||||
-rw-r--r-- | sys-boot/lilo/files/digest-lilo-22.7 | 6 | ||||
-rw-r--r-- | sys-boot/lilo/files/digest-lilo-22.7.1 | 4 | ||||
-rw-r--r-- | sys-boot/lilo/files/digest-lilo-22.7.2 | 6 | ||||
-rw-r--r-- | sys-boot/lilo/files/lilo-22.7.2-correct-usage-info.patch | 12 | ||||
-rw-r--r-- | sys-boot/lilo/files/lilo-22.7.2-create-install-dirs.patch | 21 | ||||
-rw-r--r-- | sys-boot/lilo/files/lilo-22.7.2-devmapper_gentoo.patch | 413 | ||||
-rw-r--r-- | sys-boot/lilo/files/lilo-22.7.2-manpath.patch | 12 | ||||
-rw-r--r-- | sys-boot/lilo/files/lilo-22.7.2-nostrip.patch | 12 | ||||
-rw-r--r-- | sys-boot/lilo/files/lilo-22.7.2-novga.patch | 25 | ||||
-rw-r--r-- | sys-boot/lilo/lilo-22.7.2.ebuild | 195 |
11 files changed, 716 insertions, 2 deletions
diff --git a/sys-boot/lilo/ChangeLog b/sys-boot/lilo/ChangeLog index ad6ec4a3a62d..01d31602d4f7 100644 --- a/sys-boot/lilo/ChangeLog +++ b/sys-boot/lilo/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-boot/lilo # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v 1.37 2006/01/07 13:42:35 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v 1.38 2006/07/12 13:49:07 chainsaw Exp $ + +*lilo-22.7.2 (12 Jul 2006) + + 12 Jul 2006; Tony Vroon <chainsaw@gentoo.org> + +files/lilo-22.7.2-correct-usage-info.patch, + +files/lilo-22.7.2-create-install-dirs.patch, + +files/lilo-22.7.2-devmapper_gentoo.patch, + +files/lilo-22.7.2-manpath.patch, +files/lilo-22.7.2-nostrip.patch, + +files/lilo-22.7.2-novga.patch, +lilo-22.7.2.ebuild: + Version bump. *lilo-22.7.1 (07 Jan 2006) diff --git a/sys-boot/lilo/files/digest-lilo-22.7 b/sys-boot/lilo/files/digest-lilo-22.7 index a336f127d79e..95f373867419 100644 --- a/sys-boot/lilo/files/digest-lilo-22.7 +++ b/sys-boot/lilo/files/digest-lilo-22.7 @@ -1,2 +1,6 @@ -MD5 565cda4cd5e7c740403ed91e0bdf15f6 lilo-22.7.src.tar.gz 428600 MD5 88acd6cac12da7e6da02615ba1ca6ddf dolilo-0.3.tar.bz2 3554 +RMD160 b9ae32021767b3548d6fdfe6b71d9100d81ed2ba dolilo-0.3.tar.bz2 3554 +SHA256 33ecd4f54f06067e937f442d1fd7b219f82dbcb7934311d3d20fe070cc2a30ed dolilo-0.3.tar.bz2 3554 +MD5 565cda4cd5e7c740403ed91e0bdf15f6 lilo-22.7.src.tar.gz 428600 +RMD160 76fcc2551bef7ded3d3b1c833bc76fbf1cb8c9a7 lilo-22.7.src.tar.gz 428600 +SHA256 d6372f8823243bc0d09308477f454004ad3fdb45fdef609ddeb9648995e3c063 lilo-22.7.src.tar.gz 428600 diff --git a/sys-boot/lilo/files/digest-lilo-22.7.1 b/sys-boot/lilo/files/digest-lilo-22.7.1 index c185752b2ff5..420e3633800d 100644 --- a/sys-boot/lilo/files/digest-lilo-22.7.1 +++ b/sys-boot/lilo/files/digest-lilo-22.7.1 @@ -1,2 +1,6 @@ MD5 88acd6cac12da7e6da02615ba1ca6ddf dolilo-0.3.tar.bz2 3554 +RMD160 b9ae32021767b3548d6fdfe6b71d9100d81ed2ba dolilo-0.3.tar.bz2 3554 +SHA256 33ecd4f54f06067e937f442d1fd7b219f82dbcb7934311d3d20fe070cc2a30ed dolilo-0.3.tar.bz2 3554 MD5 1f3855c6f2c7b2beaa8a90bf9975a289 lilo-22.7.1.src.tar.gz 429373 +RMD160 7be56fb510ada6a54ae7da948efc6e342d04140c lilo-22.7.1.src.tar.gz 429373 +SHA256 7fa192588910e42d0e544967e050b15e3c32acb7fdecad53c3283cbc3560a756 lilo-22.7.1.src.tar.gz 429373 diff --git a/sys-boot/lilo/files/digest-lilo-22.7.2 b/sys-boot/lilo/files/digest-lilo-22.7.2 new file mode 100644 index 000000000000..84ae9e925068 --- /dev/null +++ b/sys-boot/lilo/files/digest-lilo-22.7.2 @@ -0,0 +1,6 @@ +MD5 88acd6cac12da7e6da02615ba1ca6ddf dolilo-0.3.tar.bz2 3554 +RMD160 b9ae32021767b3548d6fdfe6b71d9100d81ed2ba dolilo-0.3.tar.bz2 3554 +SHA256 33ecd4f54f06067e937f442d1fd7b219f82dbcb7934311d3d20fe070cc2a30ed dolilo-0.3.tar.bz2 3554 +MD5 2bf1eb08c449a28ebadcf66c48a26567 lilo-22.7.2.src.tar.gz 433625 +RMD160 03fe32839751b3497dc9f06490dc2cd3bff6b805 lilo-22.7.2.src.tar.gz 433625 +SHA256 3fae019ee67a63f8fc35aade5e7f61a1dd01a210af1b46c6df4b9862597547da lilo-22.7.2.src.tar.gz 433625 diff --git a/sys-boot/lilo/files/lilo-22.7.2-correct-usage-info.patch b/sys-boot/lilo/files/lilo-22.7.2-correct-usage-info.patch new file mode 100644 index 000000000000..7b26b339f93f --- /dev/null +++ b/sys-boot/lilo/files/lilo-22.7.2-correct-usage-info.patch @@ -0,0 +1,12 @@ +--- lilo-22.7.ORIG/lilo.c 2005-05-02 01:52:16.000000000 +0100 ++++ lilo-22.7/lilo.c 2005-05-02 01:53:50.000000000 +0100 +@@ -381,7 +381,8 @@ + fprintf(errstd,"%7s%s -T help \t\t\tlist additional options\n", "", name); + fprintf(errstd,"%7s%s -X\t\t\t\tinternal compile-time options\n", "", name); + #endif /* !__MSDOS__ */ +- fprintf(errstd,"%7s%s -V [ -v ]\t\t\tversion information\n\n","",name); ++ fprintf(errstd,"%7s%s -V\t\t\t\tversion information\n","",name); ++ fprintf(errstd,"%7s%s -v\t\t\t\tverbose mode\n\n","",name); + exit(1); + } + diff --git a/sys-boot/lilo/files/lilo-22.7.2-create-install-dirs.patch b/sys-boot/lilo/files/lilo-22.7.2-create-install-dirs.patch new file mode 100644 index 000000000000..c9e58a2312a5 --- /dev/null +++ b/sys-boot/lilo/files/lilo-22.7.2-create-install-dirs.patch @@ -0,0 +1,21 @@ +--- lilo-22.5.8/Makefile.bak 2004-02-06 01:41:06.000000000 +0000 ++++ lilo-22.5.8/Makefile 2004-02-06 02:02:57.000000000 +0000 +@@ -302,16 +302,8 @@ + # normal install, but doesn't make the diagnostic binaries + # + install: all +- if [ ! -d $$ROOT$(SBIN_DIR) ]; then mkdir $$ROOT$(SBIN_DIR); fi +- if [ ! -d $$ROOT$(CFG_DIR) ]; then mkdir $$ROOT$(CFG_DIR); fi +- if [ ! -d $$ROOT$(BOOT_DIR) ]; then mkdir $$ROOT$(BOOT_DIR); fi +- if [ ! -d $$ROOT$(USRSBIN_DIR) ]; then \ +- mkdir -p $$ROOT$(USRSBIN_DIR); fi +- if [ ! -d $$ROOT$(MAN_DIR) ]; then mkdir $$ROOT$(MAN_DIR); fi +- if [ ! -d $$ROOT$(MAN_DIR)/man5 ]; then \ +- mkdir $$ROOT$(MAN_DIR)/man5; fi +- if [ ! -d $$ROOT$(MAN_DIR)/man8 ]; then \ +- mkdir $$ROOT$(MAN_DIR)/man8; fi ++ mkdir -p $$ROOT$(SBIN_DIR) $$ROOT$(CFG_DIR) $$ROOT$(BOOT_DIR) \ ++ $$ROOT$(USRSBIN_DIR) $$ROOT$(MAN_DIR)/man5 $$ROOT$(MAN_DIR)/man8 + if [ -f diag1.img ]; then \ + cp -f diag1.img $$ROOT$(BOOT_DIR); fi + if [ -f diag2.img ]; then \ diff --git a/sys-boot/lilo/files/lilo-22.7.2-devmapper_gentoo.patch b/sys-boot/lilo/files/lilo-22.7.2-devmapper_gentoo.patch new file mode 100644 index 000000000000..87921442b015 --- /dev/null +++ b/sys-boot/lilo/files/lilo-22.7.2-devmapper_gentoo.patch @@ -0,0 +1,413 @@ +diff -uNr lilo-22.7.2.ORIG/Makefile lilo-22.7.2/Makefile +--- lilo-22.7.2.ORIG/Makefile 2006-07-12 14:02:11.000000000 +0100 ++++ lilo-22.7.2/Makefile 2006-07-12 14:10:08.000000000 +0100 +@@ -65,7 +65,7 @@ + + CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \ + -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \ +- -DATARAID -DMDPRAID ++ -DATARAID -DMDPRAID -DDEVMAPPER + + # set the compiler optimization level + +@@ -109,6 +109,8 @@ + LDFLAGS=#-Xlinker -qmagic + LIBS= + ++DEVMAPPER=-ldevmapper ++ + OBJS=lilo.o raid.o map.o geometry.o boot.o device.o common.o bsect.o cfg.o \ + partition.o identify.o probe.o shs2.o edit.o temp.o + +@@ -346,10 +348,18 @@ + cp -p dparam.S dparam.s + + lilo: $(OBJS) ++ ifneq (,$(findstring DEVMAPPER,$(CONFIG))) ++ $(CC) -o lilo $(LDFLAGS) $(OBJS) $(LIBS) $(DEVMAPPER) ++ else + $(CC) -o lilo $(LDFLAGS) $(OBJS) $(LIBS) ++ endif + + lilo.static: $(OBJS) ++ ifneq (,$(findstring DEVMAPPER,$(CONFIG))) ++ $(CC) -o lilo.static -static $(LDFLAGS) $(OBJS) $(LIBS) $(DEVMAPPER) ++ else + $(CC) -o lilo.static -static $(LDFLAGS) $(OBJS) $(LIBS) ++ endif + + boot-text.b: first.b second.b + (dd if=first.b bs=512 conv=sync; dd if=second.b) >boot-text.b +diff -uNr lilo-22.7.2.ORIG/geometry.c lilo-22.7.2/geometry.c +--- lilo-22.7.2.ORIG/geometry.c 2006-07-12 14:02:11.000000000 +0100 ++++ lilo-22.7.2/geometry.c 2006-07-12 14:02:41.000000000 +0100 +@@ -15,6 +15,9 @@ + #include <stdio.h> + #include <fcntl.h> + #include <errno.h> ++#include <stdlib.h> ++#include <limits.h> ++#include <ctype.h> + #include <sys/types.h> + + #ifdef LCF_REISERFS +@@ -27,6 +30,10 @@ + + #include <string.h> + ++#ifdef LCF_DEVMAPPER ++#include <libdevmapper.h> ++#endif ++ + #include "config.h" + #include "lilo.h" + #include "common.h" +@@ -61,6 +68,25 @@ + #endif + #endif + ++#ifdef LCF_DEVMAPPER ++typedef struct _dm_target { ++ struct _dm_target *next; ++ uint64_t start,length,offset; ++ int device; ++} DM_TARGET; ++ ++typedef struct _dm_table { ++ struct _dm_table *next; ++ int device; ++ struct _dm_target *target; ++} DM_TABLE; ++ ++int dm_version_nr = 0; ++int dm_major_list[16]; ++int dm_major_nr = 0; ++DM_TABLE *dmtab = NULL; ++#endif ++ + #ifdef LCF_LVM + struct lv_bmap { + __u32 lv_block; +@@ -115,6 +141,12 @@ + { + FILE *file; + char line[MAX_LINE+1]; ++#ifdef LCF_DEVMAPPER ++ struct dm_task *dmt; ++ char major_name[32]; ++ char dm_version[32]; ++ int major; ++#endif + char *here; + DT_ENTRY *entry; + int disk_section,items; +@@ -123,29 +155,69 @@ + if ((file = fopen(name,"r")) == NULL) + die("open %s: %s",name,strerror(errno)); + } +- else if ((file = fopen(DFL_DISKTAB,"r")) == NULL) return; +- disk_section = !!disktab; +- while (fgets(line,MAX_LINE,file)) { +- here = strchr(line,'\n'); +- if (here) *here = 0; +- here = strchr(line,'#'); +- if (here) *here = 0; +- if (strspn(line," \t") != strlen(line)) { +- entry = alloc_t(DT_ENTRY); +- items = sscanf(line,"0x%x 0x%x %d %d %d %d",&entry->device, +- &entry->bios,&entry->sectors,&entry->heads,&entry->cylinders, +- &entry->start); +- if (items == 5) entry->start = -1; +- if (items < 5) +- die("Invalid line in %s:\n\"%s\"",name ? name : DFL_DISKTAB, +- line); +- entry->next = disktab; +- disktab = entry; +- if (disk_section) die("DISKTAB and DISK are mutually exclusive"); +- old_disktab = 1; ++ if (name || (file = fopen(DFL_DISKTAB,"r")) != NULL) { ++ disk_section = !!disktab; ++ while (fgets(line,MAX_LINE,file)) { ++ here = strchr(line,'\n'); ++ if (here) *here = 0; ++ here = strchr(line,'#'); ++ if (here) *here = 0; ++ if (strspn(line," \t") != strlen(line)) { ++ entry = alloc_t(DT_ENTRY); ++ items = sscanf(line,"0x%x 0x%x %d %d %d %d",&entry->device, ++ &entry->bios,&entry->sectors,&entry->heads,&entry->cylinders, ++ &entry->start); ++ if (items == 5) entry->start = -1; ++ if (items < 5) ++ die("Invalid line in %s:\n\"%s\"",name ? name : DFL_DISKTAB, ++ line); ++ entry->next = disktab; ++ disktab = entry; ++ if (disk_section) die("DISKTAB and DISK are mutually exclusive"); ++ old_disktab = 1; ++ } + } ++ (void) fclose(file); + } ++ ++#ifdef LCF_DEVMAPPER ++ if (!(dmt = dm_task_create(DM_DEVICE_VERSION))) ++ return; ++ if (!dm_task_run(dmt)) ++ return; ++ if (!dm_task_get_driver_version(dmt, dm_version, sizeof dm_version)) ++ return; ++ ++ /* ++ * to not confuse returned device number formats %02x:%02x and %d:%d ++ * we assume here that the %02x:%02x format is only found in the ioctl ++ * interface version < 4 (this is really getting ugly...) ++ */ ++ dm_version_nr = atoi(dm_version); ++ ++ dm_task_destroy(dmt); ++ ++ dm_major_nr = 0; ++ file = fopen("/proc/devices", "r"); ++ if (!file) return; ++ ++ do { ++ if (!fgets(line, (sizeof line)-1, file)) { ++ (void) fclose(file); ++ return; ++ } ++ line[(sizeof line)-1] = 0; ++ } while(strncmp(line, "Block", 5) != 0); ++ ++ while(fgets(line, (sizeof line)-1, file)) { ++ if (sscanf(line, "%d %31s\n", &major, major_name) != 2) continue; ++ if (strcmp(major_name, "device-mapper") != 0) continue; ++ dm_major_list[dm_major_nr] = major; ++ if (++dm_major_nr > (sizeof dm_major_list)/(sizeof dm_major_list[0])) break; ++ } ++ + (void) fclose(file); ++#endif + } + + +@@ -792,6 +864,161 @@ + { + DT_ENTRY *walk; + int inherited,keep_cyls,is_raid=0; ++#ifdef LCF_DEVMAPPER ++ int i; ++ ++ for(i = 0; i < dm_major_nr; i++) ++ if (MAJOR(device) == dm_major_list[i]) ++ break; ++ while (i < dm_major_nr) { ++ DM_TABLE *dm_table; ++ ++ for(dm_table = dmtab; dm_table; dm_table = dm_table->next) ++ if (dm_table->device == device) ++ break; ++ ++ if (dm_table) { ++ DM_TARGET *target; ++ ++ device = 0; ++ for(target = dm_table->target; target; target = target->next) ++ device = target->device; ++ } else { ++ DEVICE dev; ++ struct dm_task *dmt; ++ void *next = NULL; ++ char dmdev[PATH_MAX+1]; ++ char buf[PATH_MAX+1]; ++ char *slash; ++ int result; ++ ++ dev_open(&dev, device, -1); ++ strncpy(dmdev, dev.name, PATH_MAX); ++ dmdev[PATH_MAX] = 0; ++ do { ++ memset(buf, 0, PATH_MAX + 1); ++ if ((result = readlink(dmdev, buf, PATH_MAX)) < 0 && errno != EINVAL) ++ die("device-mapper: readlink(\"%s\") failed with: %s",buf, ++ strerror(errno)); ++ if (result >= 0) { ++ if (buf[0] != '/' && (slash = strrchr(dmdev, '/')) != NULL) ++ slash++; ++ else ++ slash = dmdev; ++ strncpy(slash, buf, PATH_MAX - (slash-dmdev)); ++ } ++ if (realpath(dmdev, buf) == NULL) ++ die("device-mapper: realpath(\"%s\") failed with: %s",dmdev, ++ strerror(errno)); ++ strncpy(dmdev, buf, PATH_MAX); ++ } while (result >= 0); ++ dmdev[PATH_MAX] = 0; ++ ++ if (!(dmt = dm_task_create(DM_DEVICE_TABLE))) ++ die("device-mapper: dm_task_create(DM_DEVICE_TABLE) failed"); ++ slash = strrchr(dmdev, '/'); ++ if (slash) ++ slash++; ++ else ++ slash = dmdev; ++ if (!dm_task_set_name(dmt, slash)) ++ die("device-mapper: dm_task_set_name(\"%s\") failed",dmdev); ++ if (!dm_task_run(dmt)) ++ die("device-mapper: dm_task_run(DM_DEVICE_TABLE) failed"); ++ ++ dm_table = alloc_t(DM_TABLE); ++ dm_table->device = device; ++ dm_table->target = NULL; ++ dm_table->next = dmtab; ++ dmtab = dm_table; ++ ++ device = 0; ++ ++ do { ++ DM_TARGET *target; ++ uint64_t start,length; ++ int major,minor; ++ char *target_type,*params; ++ char *p; ++ ++ next = dm_get_next_target(dmt, next, &start, &length, ++ &target_type, ¶ms); ++ ++ if (!target_type) continue; ++ ++ if (strcmp(target_type, "linear") != 0) ++ die("device-mapper: only linear boot device supported"); ++ ++ target = alloc_t(DM_TARGET); ++ target->start = start; ++ target->length = length; ++ if (dm_version_nr < 4 && ++ isxdigit(params[0]) && ++ isxdigit(params[1]) && ++ params[2] == ':' && ++ isxdigit(params[3]) && ++ isxdigit(params[4])) { /* old 2.4 format */ ++ if (sscanf(params, "%02x:%02x %"PRIu64, &major, &minor, &target->offset) != 3) ++ die("device-mapper: parse error in linear params (\"%s\")", params); ++ } else if (isdigit(params[0]) && ++ strchr(params, ':')) { /* dm_bdevname/format_dev_t (>= 2.6.0-test4?) format */ ++ if (sscanf(params, "%u:%u %"PRIu64, &major, &minor, &target->offset) != 3) ++ die("device-mapper: parse error in linear params (\"%s\")", params); ++ } else { /* >= 2.5.69 format, this should go away soon */ ++ struct stat st; ++ FILE *file; ++ ++ p = strrchr(params, ' '); ++ if (p == NULL) ++ die("device-mapper: parse error in linear params (\"%s\")", params); ++ *p = 0; ++ sprintf(buf, "/dev/%s", params); /* let's hope it's there */ ++ if (stat(buf, &st) == 0) { ++ if (!S_ISBLK(st.st_mode)) ++ die("device-mapper: %s is not a valid block device", buf); ++ major = MAJOR(st.st_rdev); ++ minor = MINOR(st.st_rdev); ++ } else { /* let's try sysfs */ ++ int dev; ++ sprintf(buf, "/sys/block/%s/dev", params); ++ file = fopen(buf, "r"); ++ if (!file) ++ die("device-mapper: \"%s\" could not be opened. /sys mounted?", buf); ++ if (!fgets(buf, PATH_MAX, file)) ++ die("device-mapper: read error from \"/sys/block/%s/dev\"", params); ++ if (sscanf(buf, "%u:%u", &major, &minor) != 2) { ++ if (sscanf(buf, "%x", &dev) != 1) ++ die("device-mapper: error getting device from \"%s\"", buf); ++ major = MAJOR(dev); ++ minor = MINOR(dev); ++ } ++ (void) fclose(file); ++ } ++ *p = ' '; ++ if (sscanf(p+1, "%"PRIu64, &target->offset) != 1) ++ die("device-mapper: parse error in linear params (\"%s\")", params); ++ } ++ target->device = (major << 8) | minor; ++ if (!device) ++ device = target->device; ++ target->next = dm_table->target; ++ dm_table->target = target; ++ } while(next); ++ ++ dm_task_destroy(dmt); ++ ++ dev_close(&dev); ++ } ++ ++ if (!device) ++ die("device-mapper: Error finding real device"); ++ geo->base_dev = device; ++ ++ for(i = 0; i < dm_major_nr; i++) ++ if (MAJOR(device) == dm_major_list[i]) ++ break; ++ } ++#endif + + if (verbose>=5) printf("geo_get: device %04X, all=%d\n", device, all); + #ifdef LCF_LVM +@@ -1188,14 +1415,50 @@ + die("EVMS boot volume cannot be on multiple disks.\n"); + sector = ebm.rsector + ((offset/SECTOR_SIZE) % geo->spb) + geo->start; + } +- else { +- sector = block*geo->spb+((offset/SECTOR_SIZE) % geo->spb); +- sector += geo->start; +- } +-#else +- sector = block*geo->spb+((offset/SECTOR_SIZE) % geo->spb); +- sector += geo->start; ++ else ++#endif ++ { ++#ifdef LCF_DEVMAPPER ++ int dev = geo->dev; ++ int i; ++#endif ++ sector = block*geo->spb+((offset/SECTOR_SIZE) % geo->spb); ++#ifdef LCF_DEVMAPPER ++ for(i = 0; i < dm_major_nr; i++) ++ if (MAJOR(dev) == dm_major_list[i]) ++ break; ++ while (i < dm_major_nr) { ++ DM_TABLE *dm_table; ++ DM_TARGET *dm_target; ++ ++ for(dm_table = dmtab; dm_table; dm_table = dm_table->next) ++ if (dm_table->device == dev) ++ break; ++ if (!dm_table) ++ die("device-mapper: Mapped device suddenly lost? (%d)", dev); ++ ++ for(dm_target = dm_table->target; dm_target; dm_target = dm_target->next) ++ if (dm_target->start <= sector && sector < (dm_target->start+dm_target->length)) ++ break; ++ if (!dm_target) ++ die("device-mapper: Sector outside mapped device? (%d: %u/%"PRIu64")", ++ geo->base_dev, sector, (uint64_t)(dm_table->target ? ++ (dm_table->target->start+dm_table->target->length) : 0)); ++ ++ dev = dm_target->device; ++ sector = dm_target->offset+(sector-dm_target->start); ++ ++ for(i = 0; i < dm_major_nr; i++) ++ if (MAJOR(dev) == dm_major_list[i]) ++ break; ++ } ++ ++ if (dev != geo->dev && dev != geo->base_dev) ++ die("device-mapper: mapped boot device cannot be on multiple real devices\n"); + #endif ++ sector += geo->start; ++ } ++ + /* DON'T always use CHS addressing on floppies: JRC */ + /* if ((geo->device & 0x80) && (linear || lba32)) { */ + if ((linear || lba32)) { diff --git a/sys-boot/lilo/files/lilo-22.7.2-manpath.patch b/sys-boot/lilo/files/lilo-22.7.2-manpath.patch new file mode 100644 index 000000000000..7860a997680e --- /dev/null +++ b/sys-boot/lilo/files/lilo-22.7.2-manpath.patch @@ -0,0 +1,12 @@ +--- lilo-22.7.1/Makefile.orig 2006-01-07 13:19:53.000000000 +0000 ++++ lilo-22.7.1/Makefile 2006-01-07 13:20:35.000000000 +0000 +@@ -81,8 +81,7 @@ + # elif [ -f /usr/bin/manpath ]; then \ + # manpath | sed "s/:.*//"; else echo /usr/man; fi` + # +-MAN_DIR=`if [ -f /usr/bin/manpath ]; then \ +- manpath | sed "s/:.*//"; else echo /usr/man; fi` ++MAN_DIR=/usr/share/man + BUILTIN=1 + + PCONFIG=$(KVER) $(LILO) `( if [ -r $$ROOT/etc/lilo.defines ]; then \ diff --git a/sys-boot/lilo/files/lilo-22.7.2-nostrip.patch b/sys-boot/lilo/files/lilo-22.7.2-nostrip.patch new file mode 100644 index 000000000000..7942476be9c1 --- /dev/null +++ b/sys-boot/lilo/files/lilo-22.7.2-nostrip.patch @@ -0,0 +1,12 @@ +diff -uNr lilo-22.7.2.ORIG/Makefile lilo-22.7.2/Makefile +--- lilo-22.7.2.ORIG/Makefile 2006-07-12 14:33:48.000000000 +0100 ++++ lilo-22.7.2/Makefile 2006-07-12 14:34:40.000000000 +0100 +@@ -238,7 +238,7 @@ + $(AS86) -w -l $*.lis -o $*.o $*.s + + .o.img: +- $(LD86) -s -o $*.img $*.o ++ $(LD86) -o $*.img $*.o + + .img.b: + dd if=$*.img of=$*.b bs=32 skip=1 diff --git a/sys-boot/lilo/files/lilo-22.7.2-novga.patch b/sys-boot/lilo/files/lilo-22.7.2-novga.patch new file mode 100644 index 000000000000..0b145eb29b70 --- /dev/null +++ b/sys-boot/lilo/files/lilo-22.7.2-novga.patch @@ -0,0 +1,25 @@ +diff -uNr lilo-22.7.2.ORIG/first.S lilo-22.7.2/first.S +--- lilo-22.7.2.ORIG/first.S 2006-07-12 14:14:16.000000000 +0100 ++++ lilo-22.7.2/first.S 2006-07-12 14:14:34.000000000 +0100 +@@ -531,7 +531,8 @@ + ; display - write byte in AL to console + ; preserves all register contents + ; +-display: pusha ! make sure no register is changed ++display: ret ++ pusha ! make sure no register is changed + mov bx,#7 ! BH=0, BL=07 + mov ah,#14 + int 0x10 +diff -uNr lilo-22.7.2.ORIG/second.S lilo-22.7.2/second.S +--- lilo-22.7.2.ORIG/second.S 2006-07-12 14:14:16.000000000 +0100 ++++ lilo-22.7.2/second.S 2006-07-12 14:14:34.000000000 +0100 +@@ -2342,7 +2342,7 @@ + ;;; xor bh,bh ; display on screen + mov bx,#7 ; set color for TEXT interface + mov ah,#14 +- int 0x10 ++;; int 0x10 + dispret: + pop bx ; restore BX + ret diff --git a/sys-boot/lilo/lilo-22.7.2.ebuild b/sys-boot/lilo/lilo-22.7.2.ebuild new file mode 100644 index 000000000000..5a732952c44a --- /dev/null +++ b/sys-boot/lilo/lilo-22.7.2.ebuild @@ -0,0 +1,195 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/lilo-22.7.2.ebuild,v 1.1 2006/07/12 13:49:07 chainsaw Exp $ + +inherit eutils flag-o-matic toolchain-funcs + +DOLILO_V="0.3" +IUSE="devmap static minimal pxeserial" + +DESCRIPTION="Standard Linux boot loader" +HOMEPAGE="http://lilo.go.dyndns.org/pub/linux/lilo/" +DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2" +MY_P=${P}.src + +SRC_URI="http://home.san.rr.com/johninsd/pub/linux/lilo/${MY_P}.tar.gz + ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/${MY_P}.tar.gz + ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/obsolete/${MY_P}.tar.gz + mirror://gentoo/${DOLILO_TAR}" + +SLOT="0" +LICENSE="BSD GPL-2" +KEYWORDS="-* ~x86 ~amd64" + +RDEPEND="devmap? ( >=sys-fs/device-mapper-1.00.08 )" +DEPEND="${RDEPEND} + >=sys-devel/bin86-0.15.5" + +PROVIDE="virtual/bootloader" + +src_unpack() { + einfo "If you want to use lilo with device mapper, please enable the" + einfo "\"devmap\" USE flag." + + unpack ${MY_P}.tar.gz + + # Do not build with DOS support + sed -i -e 's|^all:.*$|all: lilo|' ${S}/Makefile + sed -i -e 's|DOS_DIR=/dosC/boot||' ${S}/Makefile + + if use devmap; then + # devmapper-patch (boot on evms/lvm2) + cd ${S}; epatch ${FILESDIR}/${P}-devmapper_gentoo.patch + fi + + cd ${S} + + # Fix creating install dirs, bug #39405 + epatch ${FILESDIR}/${P}-create-install-dirs.patch + # Correctly document commandline options -v and -V, bug #43554 + epatch ${FILESDIR}/${P}-correct-usage-info.patch + # Install manpages to correct location, do not rely on incorrect manpath output, bug #117135 + epatch ${FILESDIR}/${P}-manpath.patch + # Do not pre-strip the binaries, this upsets portage + epatch ${FILESDIR}/${P}-nostrip.patch + + # this patch is needed when booting PXE and the device you're using + # emulates vga console via serial console. + # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping. + use pxeserial && epatch ${FILESDIR}/${P}-novga.patch + + unpack ${DOLILO_TAR} +} + +src_compile() { + # hardened automatic PIC plus PIE building should be suppressed + # because of assembler instructions that cannot be compiled PIC + HARDENED_CFLAGS="`test-flags-CC -fno-pic -nopie`" + + # we explicitly prevent the custom CFLAGS for stability reasons + if use static; then + emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo.static || die + mv lilo.static lilo || die + else + emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo || die + fi +} + +src_install() { + keepdir /boot + make ROOT=${D} install || die + + if use !minimal; then + into / + dosbin ${S}/dolilo/dolilo + + into /usr + dosbin keytab-lilo.pl + + insinto /etc + newins ${FILESDIR}/lilo.conf lilo.conf.example + + insinto /etc/conf.d + newins ${S}/dolilo/dolilo.conf.d dolilo.example + + doman manPages/*.[5-8] + dodoc CHANGES COPYING INCOMPAT README* + docinto samples ; dodoc sample/* + fi +} + +# Check whether LILO is installed +# This function is from /usr/sbin/mkboot from debianutils, with copyright: +# +# Debian GNU/Linux +# Copyright 1996-1997 Guy Maor <maor@debian.org> +# +# Modified for Gentoo for use with the lilo ebuild by: +# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003) +# +lilocheck () { + local bootpart= + local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")" + + echo + einfon "Checking for LILO ..." + + if [ "$(whoami)" != "root" ] + then + echo; echo + eerror "Only root can check for LILO!" + return 1 + fi + + if [ -z "${rootpart}" ] + then + echo; echo + eerror "Could not determine root partition!" + return 1 + fi + + if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ] + then + echo " No" + return 1 + fi + + bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)" + + if [ -z "${bootpart}" ] + then + # lilo defaults to current root when 'boot=' is not present + bootpart="${rootpart}" + fi + + if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO' + then + echo; echo + ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}" + ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand." + return 1 + fi + + echo " Yes, on ${bootpart}" + + return 0 +} + + +pkg_postinst() { + if [ ! -e ${ROOT}/boot/boot.b -a ! -L ${ROOT}/boot/boot.b ] + then + [ -f "${ROOT}/boot/boot-menu.b" ] && \ + ln -snf boot-menu.b ${ROOT}/boot/boot.b + fi + + if [ "${ROOT}" = "/" ] && use !minimal; + then + if lilocheck + then + einfo "Running DOLILO to complete the install ..." + # do not redirect to /dev/null because it may display some input + # prompt + /sbin/dolilo + if [ "$?" -ne 0 ] + then + echo + ewarn "Running /sbin/dolilo failed! Please check what the problem is" + ewarn "before your next reboot." + + ebeep 5 + epause 5 + fi + fi + echo + fi + if use !minimal; then + echo + einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that" + einfo "handles mounting and unmounting /boot for you. It can do more then" + einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential." + ebeep 5 + epause 3 + echo + fi +} |