# ChangeLog for sys-boot/lilo
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v 1.46 2007/03/20 10:46:25 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v 1.47 2007/03/20 10:49:13 chainsaw Exp $
+
+ 20 Mar 2007; Tony Vroon <chainsaw@gentoo.org>
+ -files/lilo-22.7.1-correct-usage-info.patch,
+ -files/lilo-22.7.1-create-install-dirs.patch,
+ -files/lilo-22.7.1-devmapper_gentoo.patch,
+ -files/lilo-22.7.1-manpath.patch, -files/lilo-22.7.1-novga.patch,
+ -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-install-nostrip.patch,
+ -files/lilo-22.7.2-makefile.patch, -files/lilo-22.7.2-manpath.patch,
+ -files/lilo-22.7.2-novga.patch, -files/lilo-22.7-correct-usage-info.patch,
+ -files/lilo-22.7-create-install-dirs.patch,
+ -files/lilo-22.7-devmapper_gentoo.patch,
+ -files/lilo-22.7-install-nostrip.patch, -files/lilo-22.7-manpath.patch,
+ -files/lilo-22.7-novga.patch:
+ Delete orphaned patches as well.
*lilo-22.8 (20 Mar 2007)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-AUX lilo-22.7-correct-usage-info.patch 557 RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 SHA1 572ae21eb4f65aed1410638fbd416eb4cee6d64c SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281
-MD5 de6a5065fca97cf5df35c8bc9bebfafc files/lilo-22.7-correct-usage-info.patch 557
-RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 files/lilo-22.7-correct-usage-info.patch 557
-SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281 files/lilo-22.7-correct-usage-info.patch 557
-AUX lilo-22.7-create-install-dirs.patch 970 RMD160 e9832538d601043e7e82a4f597a994f16db6436f SHA1 fbf819af1670123832555450a580d7b9f22b5477 SHA256 909c9b083758a6be0a7cd6003f300d49947096b2b033fab0d25c30abeaa498f9
-MD5 2419c22323e1cfdbbc1ca149cb05e74d files/lilo-22.7-create-install-dirs.patch 970
-RMD160 e9832538d601043e7e82a4f597a994f16db6436f files/lilo-22.7-create-install-dirs.patch 970
-SHA256 909c9b083758a6be0a7cd6003f300d49947096b2b033fab0d25c30abeaa498f9 files/lilo-22.7-create-install-dirs.patch 970
-AUX lilo-22.7-devmapper_gentoo.patch 12072 RMD160 ce0e48e693c33ddbcac175f9cd0708a8c249eb9e SHA1 35ea0e39b8cb914f9accfdbf361219bb772ca8e1 SHA256 25ae7d3da0301bc5ee7cc40ac8db836d67b2b4611f8ec061267ced933cd63397
-MD5 c3e5c4bfabecddb7a57c3cdce9e21c3a files/lilo-22.7-devmapper_gentoo.patch 12072
-RMD160 ce0e48e693c33ddbcac175f9cd0708a8c249eb9e files/lilo-22.7-devmapper_gentoo.patch 12072
-SHA256 25ae7d3da0301bc5ee7cc40ac8db836d67b2b4611f8ec061267ced933cd63397 files/lilo-22.7-devmapper_gentoo.patch 12072
-AUX lilo-22.7-install-nostrip.patch 404 RMD160 ae3171720b836099d4551699fed1c7313e256cf3 SHA1 8d75cf944cd5ef6e8c0621c79c059a7992eea09b SHA256 4c155d0e99c2b392e020f365ef29a537aeee666b2936dccce45cbbf068b39c3c
-MD5 0fcf055d223be459d137aff98d933591 files/lilo-22.7-install-nostrip.patch 404
-RMD160 ae3171720b836099d4551699fed1c7313e256cf3 files/lilo-22.7-install-nostrip.patch 404
-SHA256 4c155d0e99c2b392e020f365ef29a537aeee666b2936dccce45cbbf068b39c3c files/lilo-22.7-install-nostrip.patch 404
-AUX lilo-22.7-manpath.patch 444 RMD160 8bdbb45e5fe7b6c9249d54657978b59190eba104 SHA1 f8055e0299a0a30e4cc3910c359ae3a826fec3b9 SHA256 78ca7d4bfe78103de450de92bd321a0b4233d15f1051df3d0e4206fd061381ea
-MD5 73796418d202ed39a04f9adbd5ccc12a files/lilo-22.7-manpath.patch 444
-RMD160 8bdbb45e5fe7b6c9249d54657978b59190eba104 files/lilo-22.7-manpath.patch 444
-SHA256 78ca7d4bfe78103de450de92bd321a0b4233d15f1051df3d0e4206fd061381ea files/lilo-22.7-manpath.patch 444
-AUX lilo-22.7-novga.patch 936 RMD160 30006a534dbfa228de51c076e026c3b560d42630 SHA1 6cc1892cd5e2856a8fa73c50bcb29cbe7fe5ef32 SHA256 796e342f3fcaddd80c08eab791559074529224cfdf7e5a7f0dee8f2cdbf4657b
-MD5 78f9720430dac90363e7b5120a262a3a files/lilo-22.7-novga.patch 936
-RMD160 30006a534dbfa228de51c076e026c3b560d42630 files/lilo-22.7-novga.patch 936
-SHA256 796e342f3fcaddd80c08eab791559074529224cfdf7e5a7f0dee8f2cdbf4657b files/lilo-22.7-novga.patch 936
-AUX lilo-22.7.1-correct-usage-info.patch 557 RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 SHA1 572ae21eb4f65aed1410638fbd416eb4cee6d64c SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281
-MD5 de6a5065fca97cf5df35c8bc9bebfafc files/lilo-22.7.1-correct-usage-info.patch 557
-RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 files/lilo-22.7.1-correct-usage-info.patch 557
-SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281 files/lilo-22.7.1-correct-usage-info.patch 557
-AUX lilo-22.7.1-create-install-dirs.patch 970 RMD160 e9832538d601043e7e82a4f597a994f16db6436f SHA1 fbf819af1670123832555450a580d7b9f22b5477 SHA256 909c9b083758a6be0a7cd6003f300d49947096b2b033fab0d25c30abeaa498f9
-MD5 2419c22323e1cfdbbc1ca149cb05e74d files/lilo-22.7.1-create-install-dirs.patch 970
-RMD160 e9832538d601043e7e82a4f597a994f16db6436f files/lilo-22.7.1-create-install-dirs.patch 970
-SHA256 909c9b083758a6be0a7cd6003f300d49947096b2b033fab0d25c30abeaa498f9 files/lilo-22.7.1-create-install-dirs.patch 970
-AUX lilo-22.7.1-devmapper_gentoo.patch 12072 RMD160 ce0e48e693c33ddbcac175f9cd0708a8c249eb9e SHA1 35ea0e39b8cb914f9accfdbf361219bb772ca8e1 SHA256 25ae7d3da0301bc5ee7cc40ac8db836d67b2b4611f8ec061267ced933cd63397
-MD5 c3e5c4bfabecddb7a57c3cdce9e21c3a files/lilo-22.7.1-devmapper_gentoo.patch 12072
-RMD160 ce0e48e693c33ddbcac175f9cd0708a8c249eb9e files/lilo-22.7.1-devmapper_gentoo.patch 12072
-SHA256 25ae7d3da0301bc5ee7cc40ac8db836d67b2b4611f8ec061267ced933cd63397 files/lilo-22.7.1-devmapper_gentoo.patch 12072
-AUX lilo-22.7.1-manpath.patch 444 RMD160 8bdbb45e5fe7b6c9249d54657978b59190eba104 SHA1 f8055e0299a0a30e4cc3910c359ae3a826fec3b9 SHA256 78ca7d4bfe78103de450de92bd321a0b4233d15f1051df3d0e4206fd061381ea
-MD5 73796418d202ed39a04f9adbd5ccc12a files/lilo-22.7.1-manpath.patch 444
-RMD160 8bdbb45e5fe7b6c9249d54657978b59190eba104 files/lilo-22.7.1-manpath.patch 444
-SHA256 78ca7d4bfe78103de450de92bd321a0b4233d15f1051df3d0e4206fd061381ea files/lilo-22.7.1-manpath.patch 444
-AUX lilo-22.7.1-novga.patch 936 RMD160 30006a534dbfa228de51c076e026c3b560d42630 SHA1 6cc1892cd5e2856a8fa73c50bcb29cbe7fe5ef32 SHA256 796e342f3fcaddd80c08eab791559074529224cfdf7e5a7f0dee8f2cdbf4657b
-MD5 78f9720430dac90363e7b5120a262a3a files/lilo-22.7.1-novga.patch 936
-RMD160 30006a534dbfa228de51c076e026c3b560d42630 files/lilo-22.7.1-novga.patch 936
-SHA256 796e342f3fcaddd80c08eab791559074529224cfdf7e5a7f0dee8f2cdbf4657b files/lilo-22.7.1-novga.patch 936
-AUX lilo-22.7.2-correct-usage-info.patch 557 RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 SHA1 572ae21eb4f65aed1410638fbd416eb4cee6d64c SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281
-MD5 de6a5065fca97cf5df35c8bc9bebfafc files/lilo-22.7.2-correct-usage-info.patch 557
-RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 files/lilo-22.7.2-correct-usage-info.patch 557
-SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281 files/lilo-22.7.2-correct-usage-info.patch 557
-AUX lilo-22.7.2-create-install-dirs.patch 970 RMD160 e9832538d601043e7e82a4f597a994f16db6436f SHA1 fbf819af1670123832555450a580d7b9f22b5477 SHA256 909c9b083758a6be0a7cd6003f300d49947096b2b033fab0d25c30abeaa498f9
-MD5 2419c22323e1cfdbbc1ca149cb05e74d files/lilo-22.7.2-create-install-dirs.patch 970
-RMD160 e9832538d601043e7e82a4f597a994f16db6436f files/lilo-22.7.2-create-install-dirs.patch 970
-SHA256 909c9b083758a6be0a7cd6003f300d49947096b2b033fab0d25c30abeaa498f9 files/lilo-22.7.2-create-install-dirs.patch 970
-AUX lilo-22.7.2-devmapper_gentoo.patch 12011 RMD160 639170c6b7e7e492cadcf225e2d2a8fa4d8d4a2d SHA1 56f6138e59ef17ef637e07de9933dd806c1adc1a SHA256 6cc182ebee108f1283e55df821b11dabd1ed570bc5e1d2bdf04417d386559786
-MD5 c2cf6011f04975f8244509a127b3b841 files/lilo-22.7.2-devmapper_gentoo.patch 12011
-RMD160 639170c6b7e7e492cadcf225e2d2a8fa4d8d4a2d files/lilo-22.7.2-devmapper_gentoo.patch 12011
-SHA256 6cc182ebee108f1283e55df821b11dabd1ed570bc5e1d2bdf04417d386559786 files/lilo-22.7.2-devmapper_gentoo.patch 12011
-AUX lilo-22.7.2-install-nostrip.patch 404 RMD160 ae3171720b836099d4551699fed1c7313e256cf3 SHA1 8d75cf944cd5ef6e8c0621c79c059a7992eea09b SHA256 4c155d0e99c2b392e020f365ef29a537aeee666b2936dccce45cbbf068b39c3c
-MD5 0fcf055d223be459d137aff98d933591 files/lilo-22.7.2-install-nostrip.patch 404
-RMD160 ae3171720b836099d4551699fed1c7313e256cf3 files/lilo-22.7.2-install-nostrip.patch 404
-SHA256 4c155d0e99c2b392e020f365ef29a537aeee666b2936dccce45cbbf068b39c3c files/lilo-22.7.2-install-nostrip.patch 404
-AUX lilo-22.7.2-makefile.patch 723 RMD160 4bcf3e62060d2f778bd8d3f3c3790571b8dc42b2 SHA1 706159cbcad3da2e06015dfd5e9b8ae2fb92e23c SHA256 66edfdcc7357315bde6af0a6bdb714314a9027f88e4bf8b460f0d1cafd2053cc
-MD5 8d1cb16484ed9fb3437a2d7a29d6858b files/lilo-22.7.2-makefile.patch 723
-RMD160 4bcf3e62060d2f778bd8d3f3c3790571b8dc42b2 files/lilo-22.7.2-makefile.patch 723
-SHA256 66edfdcc7357315bde6af0a6bdb714314a9027f88e4bf8b460f0d1cafd2053cc files/lilo-22.7.2-makefile.patch 723
-AUX lilo-22.7.2-manpath.patch 444 RMD160 8bdbb45e5fe7b6c9249d54657978b59190eba104 SHA1 f8055e0299a0a30e4cc3910c359ae3a826fec3b9 SHA256 78ca7d4bfe78103de450de92bd321a0b4233d15f1051df3d0e4206fd061381ea
-MD5 73796418d202ed39a04f9adbd5ccc12a files/lilo-22.7.2-manpath.patch 444
-RMD160 8bdbb45e5fe7b6c9249d54657978b59190eba104 files/lilo-22.7.2-manpath.patch 444
-SHA256 78ca7d4bfe78103de450de92bd321a0b4233d15f1051df3d0e4206fd061381ea files/lilo-22.7.2-manpath.patch 444
-AUX lilo-22.7.2-novga.patch 804 RMD160 1b2391b1f92d48c1db5623ec9b4eec34844078d6 SHA1 2bee42b35344ab5b2a63d354c61c7b44aec75627 SHA256 812da9b2afb785a0aca27fe9b0d8a06b982792d60cd6b4b6dda16c7b6a73b297
-MD5 e42ba9cd707df24649879cc297377cf9 files/lilo-22.7.2-novga.patch 804
-RMD160 1b2391b1f92d48c1db5623ec9b4eec34844078d6 files/lilo-22.7.2-novga.patch 804
-SHA256 812da9b2afb785a0aca27fe9b0d8a06b982792d60cd6b4b6dda16c7b6a73b297 files/lilo-22.7.2-novga.patch 804
AUX lilo-22.7.3-correct-usage-info.patch 557 RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 SHA1 572ae21eb4f65aed1410638fbd416eb4cee6d64c SHA256 dc32b41ef2024c7b38b3dde281ac1dae69f9353ce56adce79ca4030b13c65281
MD5 de6a5065fca97cf5df35c8bc9bebfafc files/lilo-22.7.3-correct-usage-info.patch 557
RMD160 00947306d7b609ae0a0129e0a3f820a51a4d1f75 files/lilo-22.7.3-correct-usage-info.patch 557
MD5 a2544f0c47bad043a7a248b82fdd10dd lilo-22.8.ebuild 4514
RMD160 ce02e00f97936be4022587a195462626d2e71679 lilo-22.8.ebuild 4514
SHA256 ac55e299c61e93df72faa6b4f3f0af43d90749eebcd13f070d5b38e566c96290 lilo-22.8.ebuild 4514
-MISC ChangeLog 7972 RMD160 3d2250b558d6e0db599058c00fb4aa7c9fe98fcc SHA1 42c8ff3dc97319732409f4206e52e7f18763223f SHA256 6b69d834c06460e7603f292a355d2fbd019a4deddee0c9f2e7263ceccfe22695
-MD5 3f1beebe2513fe034c832637ed3d711c ChangeLog 7972
-RMD160 3d2250b558d6e0db599058c00fb4aa7c9fe98fcc ChangeLog 7972
-SHA256 6b69d834c06460e7603f292a355d2fbd019a4deddee0c9f2e7263ceccfe22695 ChangeLog 7972
+MISC ChangeLog 8791 RMD160 08e18f9e5d2237cc969a8282854197991d057038 SHA1 d171d4a974d20dbd0e61af9925b522898ee2de06 SHA256 ce1f3331d9f56c9ab8d119f6699310a1f46a48c8552c391f00fa25b08e8af1f0
+MD5 1d4e50b251953ea92e6dd9b1d32a5284 ChangeLog 8791
+RMD160 08e18f9e5d2237cc969a8282854197991d057038 ChangeLog 8791
+SHA256 ce1f3331d9f56c9ab8d119f6699310a1f46a48c8552c391f00fa25b08e8af1f0 ChangeLog 8791
MISC metadata.xml 254 RMD160 823c99a514af57fe285c45f08538b7cc18e6342a SHA1 de5f6d0faac7d5f11daa399f9e875c30cac2ce64 SHA256 2817a53a07dd68fef8ec5467cb1a8441e87d77bd7eaf8ce9971de1adfbab7bdc
MD5 eeee4743c4e463eeed3a7a4c15380e0d metadata.xml 254
RMD160 823c99a514af57fe285c45f08538b7cc18e6342a metadata.xml 254
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (GNU/Linux)
-iD8DBQFF/7tsp5vW4rUFj5oRApdWAJ9ojcPUFE02F1HhASH6tiQlnwFaagCglSik
-jowxx5BhdgE9lFB+rce3KbY=
-=d4lA
+iD8DBQFF/7wRp5vW4rUFj5oRAjv+AJ9mrGKRfcdhEQSNx8hD7ATzFgBo6gCghWVP
+HFkaO8JArBlCaWJVV37/6bc=
+=q+p6
-----END PGP SIGNATURE-----
+++ /dev/null
---- 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);
- }
-
+++ /dev/null
---- 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 \
+++ /dev/null
-diff -Nur lilo-22.6.1.orig/geometry.c lilo-22.6.1/geometry.c
---- lilo-22.6.1.orig/geometry.c 2004-11-16 08:11:03.000000000 +0100
-+++ lilo-22.6.1/geometry.c 2005-03-15 00:13:42.761215192 +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
- }
-
-
-@@ -777,6 +849,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
-@@ -1154,14 +1381,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 -Nur lilo-22.6.1.orig/Makefile lilo-22.6.1/Makefile
---- lilo-22.6.1.orig/Makefile 2004-11-17 19:41:56.000000000 +0100
-+++ lilo-22.6.1/Makefile 2005-03-15 00:14:28.277295696 +0100
-@@ -59,7 +59,7 @@
- # XL_SECS=n Support for extra large (non-standard) floppies.
-
- CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DONE_SHOT -DPASS160 \
-- -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL
-+ -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL -DDEVMAPPER
-
- # set the compiler optimization level
-
-@@ -101,6 +101,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
-
-@@ -291,10 +293,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
+++ /dev/null
---- lilo-22.7.2/Makefile~ 2006-07-13 15:10:06.000000000 +0200
-+++ lilo-22.7.2/Makefile 2006-07-13 15:12:47.000000000 +0200
-@@ -439,7 +439,6 @@
- rm -f $$ROOT$(BOOT_DIR)/boot.b; fi
- cp mkrescue $$ROOT$(SBIN_DIR)
- cp lilo $$ROOT$(SBIN_DIR)
-- strip $$ROOT$(SBIN_DIR)/lilo
- cp keytab-lilo.pl $$ROOT$(USRSBIN_DIR)
- cp manPages/lilo.8 $$ROOT$(MAN_DIR)/man8
- cp manPages/mkrescue.8 $$ROOT$(MAN_DIR)/man8
+++ /dev/null
---- 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 \
+++ /dev/null
-diff -u lilo-22.6.1/first.S lilo-22.6.1.novga/first.S
---- lilo-22.6.1/first.S 2004-08-31 12:39:25.000000000 -0700
-+++ lilo-22.6.1.novga/first.S 2004-12-06 14:47:22.000000000 -0800
-@@ -522,7 +522,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 -u lilo-22.6.1/second.S lilo-22.6.1.novga/second.S
---- lilo-22.6.1/second.S 2004-11-15 18:59:35.000000000 -0800
-+++ lilo-22.6.1.novga/second.S 2004-12-06 14:49:03.000000000 -0800
-@@ -2155,7 +2155,7 @@
-
- ! Display one character on the console
-
--display:
-+display:
- push bx ! save BX
-
- #ifndef LCF_NOSERIAL
-@@ -2219,7 +2219,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
+++ /dev/null
---- 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);
- }
-
+++ /dev/null
---- 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 \
+++ /dev/null
-diff -Nur lilo-22.6.1.orig/geometry.c lilo-22.6.1/geometry.c
---- lilo-22.6.1.orig/geometry.c 2004-11-16 08:11:03.000000000 +0100
-+++ lilo-22.6.1/geometry.c 2005-03-15 00:13:42.761215192 +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
- }
-
-
-@@ -777,6 +849,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
-@@ -1154,14 +1381,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 -Nur lilo-22.6.1.orig/Makefile lilo-22.6.1/Makefile
---- lilo-22.6.1.orig/Makefile 2004-11-17 19:41:56.000000000 +0100
-+++ lilo-22.6.1/Makefile 2005-03-15 00:14:28.277295696 +0100
-@@ -59,7 +59,7 @@
- # XL_SECS=n Support for extra large (non-standard) floppies.
-
- CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DONE_SHOT -DPASS160 \
-- -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL
-+ -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL -DDEVMAPPER
-
- # set the compiler optimization level
-
-@@ -101,6 +101,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
-
-@@ -291,10 +293,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
+++ /dev/null
---- 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 \
+++ /dev/null
-diff -u lilo-22.6.1/first.S lilo-22.6.1.novga/first.S
---- lilo-22.6.1/first.S 2004-08-31 12:39:25.000000000 -0700
-+++ lilo-22.6.1.novga/first.S 2004-12-06 14:47:22.000000000 -0800
-@@ -522,7 +522,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 -u lilo-22.6.1/second.S lilo-22.6.1.novga/second.S
---- lilo-22.6.1/second.S 2004-11-15 18:59:35.000000000 -0800
-+++ lilo-22.6.1.novga/second.S 2004-12-06 14:49:03.000000000 -0800
-@@ -2155,7 +2155,7 @@
-
- ! Display one character on the console
-
--display:
-+display:
- push bx ! save BX
-
- #ifndef LCF_NOSERIAL
-@@ -2219,7 +2219,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
+++ /dev/null
---- 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);
- }
-
+++ /dev/null
---- 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 \
+++ /dev/null
-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)) {
+++ /dev/null
---- lilo-22.7.2/Makefile~ 2006-07-13 15:10:06.000000000 +0200
-+++ lilo-22.7.2/Makefile 2006-07-13 15:12:47.000000000 +0200
-@@ -439,7 +439,6 @@
- rm -f $$ROOT$(BOOT_DIR)/boot.b; fi
- cp mkrescue $$ROOT$(SBIN_DIR)
- cp lilo $$ROOT$(SBIN_DIR)
-- strip $$ROOT$(SBIN_DIR)/lilo
- cp keytab-lilo.pl $$ROOT$(USRSBIN_DIR)
- cp manPages/lilo.8 $$ROOT$(MAN_DIR)/man8
- cp manPages/mkrescue.8 $$ROOT$(MAN_DIR)/man8
+++ /dev/null
---- Makefile.orig 2006-09-05 12:11:46.000000000 +0100
-+++ Makefile 2006-09-05 12:12:11.000000000 +0100
-@@ -77,8 +77,7 @@
- CFG_DIR=/etc
- BOOT_DIR=/boot
- USRSBIN_DIR=/usr/sbin
--# set the following if you wish LILO.COM to be installed
--DOS_DIR=/dosC/boot
-+
- #
- #MAN_DIR=`if [ -z "$(whereis lilo | grep 'lilo.8')" ]; then \
- # whereis lilo | sed -e "sX.* /usrX/usrX" -e "sX/man8/lilo.8.*XX" ; \
-@@ -155,10 +154,7 @@
- #
- # everything needed to run, just short of installation
- #
--all: lilo bootsect.b diag1.img # OBSOLETE: $(BOOTS) edit dparam.com activate
-- if [ -x /usr/bin/bcc -o -x /usr/local/bin/bcc ]; then \
-- make diagnostic; \
-- make dosexe; fi
-+all: lilo
-
- #
- # everything above plus the statically linked version
+++ /dev/null
---- 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 \
+++ /dev/null
-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