diff --git a/make.vars b/make.vars index 4e47243..1640b3a 100644 --- lilo/make.vars +++ lilo/make.vars @@ -71,7 +71,7 @@ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \ - -DMDPRAID -DDEVMAPPER + -DMDPRAID -DDEVMAPPER -DBLKID # set the following if you wish LILO.COM to be installed DOS_DIR=/dosC/boot diff --git a/src/Makefile b/src/Makefile index 9ac890a..7e9b2c5 100644 --- lilo/src/Makefile +++ lilo/src/Makefile @@ -25,6 +25,10 @@ G=`cat foo1 foo2 | grep version | cut -d " " -f 3` CFLAGS=$(OPT) -Wall $(PCONFIG) LIBS=$(DEVMAPPER) +ifneq (,$(findstring BLKID,$(CONFIG))) +LIBS+=-lblkid +endif + 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 diff --git a/src/lilo.c b/src/lilo.c index a7db803..f0345d4 100644 --- lilo/src/lilo.c +++ lilo/src/lilo.c @@ -22,6 +22,10 @@ #include /*#include */ +#ifdef LCF_BLKID +#include +#endif + #include "config.h" #include "lilo.h" #include "common.h" @@ -921,6 +925,20 @@ fprintf(errstd,"argc=%d, *argv=%s, ch=%c param=%s\n", argc, *argv, ch, param); " disk addresses below the 1024 cylinder limit; LBA32 specifies 32-bit disk\n" " addresses not subject to cylinder limits on systems with EDD-BIOS extensions;\n" " use LINEAR only if you are aware of its limitations."); + +#ifdef LCF_BLKID +{ + char *boot_dev = cfg_get_strg(cf_options, "boot"); + + if (boot_dev && strlen(boot_dev) > 5 && !strncmp(boot_dev, "UUID=", 5)) { + char *dev = blkid_get_devname(NULL, boot_dev, NULL); + if (!dev) + die("%s: boot device not found", boot_dev); + cfg_unset(cf_options, "boot"); + cfg_set(cf_options, "boot", dev, NULL); + } +} +#endif if (identify) identify_image(identify,ident_opt);