commit 159ec24312ded41371a222d8c5cb3458cf9f2cd2 Author: Jacob Welsh AuthorDate: Tue Apr 5 04:10:42 2022 +0000 Commit: Jacob Welsh CommitDate: Tue Apr 5 04:14:37 2022 +0000 Remove confused & confusing error case for the Block Extended Major This should allow use of nvme block devices and perhaps other such recent drivers. Linux's Documentation/devices.txt does not substantiate the "high partitions (>15) on SATA hard disks" interpretation for majors 259 and 260. diff --git a/src/geometry.c b/src/geometry.c index 37db455..35b8ef2 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -298,7 +298,7 @@ int has_partitions_beta(dev_t dev) (major >= MAJOR_CISS && major <= MAJOR_CISS+7) || major == MAJOR_FTL || major == MAJOR_NFTL || major == MAJOR_DOC || (major >= MAJOR_SD9 && major <= MAJOR_SD16) || - (major >= MAJOR_SATA1 && major <= MAJOR_SATA2) + (major == MAJOR_BLKEXT) ) return 0xFFFFFFF0; /* 4 bit partition mask */ if ( major == MAJOR_CARM1 || major == MAJOR_CARM2 @@ -670,28 +670,21 @@ void geo_query_dev(GEOMETRY *geo,int device,int all) case MAJOR_SD6: case MAJOR_SD7: case MAJOR_SD8: + case MAJOR_BLKEXT: MASK15: geo->device = 0x80 + last_dev(MAJOR_HD,64) + (MINOR(device) >> 4); + /* ^ pretty much guesswork as we don't know how the BIOS will enumerate drives, especially if there's a mix of interface technologies or the boot device changes */ if (!get_all) break; if (ioctl(fd,HDIO_GETGEO,&hdprm) < 0) die("geo_query_dev HDIO_GETGEO (dev 0x%04x): %s",device, strerror(errno)); if (all && !hdprm.sectors) - die("HDIO_REQ not supported for your SCSI controller. Please " - "use a DISK section"); + die("HDIO_REQ not supported for device 0x%04x. Please use a DISK section",device); geo->heads = hdprm.heads; geo->cylinders = hdprm.cylinders; geo->sectors = hdprm.sectors; geo->start = hdprm.start; break; - case MAJOR_SATA1: - case MAJOR_SATA2: - printf("WARNING: SATA partition in the high region (>15):\n"); - printf("LILO needs the kernel in one of the first 15 SATA partitions. If \n"); - printf("you need support for kernel in SATA partitions of the high region \n"); - printf("than try grub2 for this purpose! \n"); - die("Sorry, cannot handle device 0x%04x",device); - break; MASK31: geo->device = 0x80 + last_dev(MAJOR_HD,64) + (MINOR(device) >> 5); if (!get_all) break; diff --git a/src/lilo.h b/src/lilo.h index 9b1d938..dcb7ed2 100644 --- a/src/lilo.h +++ b/src/lilo.h @@ -137,9 +137,7 @@ /* don't use the following */ #define MAJOR_MDP 254 /* Enhanced multi-disk RAID sets [experimental?] */ -/* high partitions (>15) on SATA hard disks */ -#define MAJOR_SATA1 259 /* high SATA disk partitions */ -#define MAJOR_SATA2 260 /* high SATA disk partitions */ +#define MAJOR_BLKEXT 259 /* Block Extended Major, used dynamically e.g. by NVMe */ #define MAX_TOKEN 1023 /* max device Token length */ #define MAX_IMAGE_NAME 15 /* maximum name length (w/o terminating NUL) */