wok-current view lilo/stuff/lilo.nvme.support.diff @ rev 25792
Fix openbox menu, label keymap on lxpanel and add miss it translation for tazpkg
| author | Stanislas Leduc <shann@slitaz.org> |
|---|---|
| date | Tue Oct 07 05:55:24 2025 +0000 (2 weeks ago) |
| parents | |
| children |
line source
1 diff -Naru lilo-24.2/src/common.h lilo-24.2.new/src/common.h
2 --- lilo-24.2/src/common.h 2015-11-21 23:50:23.000000000 +0000
3 +++ lilo-24.2.new/src/common.h 2018-02-15 15:13:17.411968439 +0000
4 @@ -386,7 +386,7 @@
5 extern FILE *errstd;
6 extern FILE *pp_fd;
7 extern char *identify; /* in identify.c */
8 -extern int dm_major_list[16];
9 +extern int dm_major_list[32];
10 extern int dm_major_nr;
12 #define crc(a,b) (~crc32((a),(b),CRC_POLY1))
13 diff -Naru lilo-24.2/src/geometry.c lilo-24.2.new/src/geometry.c
14 --- lilo-24.2/src/geometry.c 2015-11-21 23:50:18.000000000 +0000
15 +++ lilo-24.2.new/src/geometry.c 2018-02-15 16:10:25.844149725 +0000
16 @@ -84,8 +84,9 @@
17 int dm_version_nr = 0;
18 #endif
20 -int dm_major_list[16];
21 +int dm_major_list[32]; /* increased from 16 to allow for nvme disks */
22 int dm_major_nr;
23 +int nvme_pr = 0; /* set to none zero after geo_init if nvme disk present */
25 #ifdef LCF_LVM
26 struct lv_bmap {
27 @@ -200,6 +201,9 @@
29 while(fgets(line, (sizeof line)-1, file)) {
30 if (sscanf(line, "%d %31s\n", &major, major_name) != 2) continue;
31 + if (strcmp(major_name, "nvme") !=0) { /* set if nvme drive is present */
32 + nvme_pr=-1;
33 + }
34 if (strcmp(major_name, "device-mapper") != 0) continue;
35 dm_major_list[dm_major_nr] = major;
36 if (verbose >= 3) {
37 @@ -708,6 +712,22 @@
38 geo->start = hdprm.start;
39 break;
40 case MAJOR_SATA1:
41 + /* check for nvme device and assume boot/this device is nvme if present */
42 + if (nvme_pr != 0) {
43 + geo->device = 0x80 + last_dev(MAJOR_IDE,64) + (MINOR(device) >> 4);
44 + if (!get_all) break;
45 + if (ioctl(fd,HDIO_GETGEO,&hdprm) < 0)
46 + die("geo_query_dev HDIO_GETGEO (dev 0x%04x): %s",device,
47 + strerror(errno));
48 + if (all && !hdprm.sectors)
49 + die("HDIO_REQ not supported for your NVME controller. Please "
50 + "use a DISK section");
51 + geo->heads = hdprm.heads;
52 + geo->cylinders = hdprm.cylinders;
53 + geo->sectors = hdprm.sectors;
54 + geo->start = hdprm.start;
55 + break;
56 + }
57 case MAJOR_SATA2:
58 printf("WARNING: SATA partition in the high region (>15):\n");
59 printf("LILO needs the kernel in one of the first 15 SATA partitions. If \n");
60 diff -Naru lilo-24.2/src/lilo.h lilo-24.2.new/src/lilo.h
61 --- lilo-24.2/src/lilo.h 2015-11-21 23:50:20.000000000 +0000
62 +++ lilo-24.2.new/src/lilo.h 2018-02-15 15:27:35.647786827 +0000
63 @@ -245,6 +245,7 @@
65 /* high partitions (>15) on SATA hard disks */
66 #define MAJOR_SATA1 259 /* high SATA disk partitions (Block Extended Major) */
67 + /* also used by kernel for nvme disks */
68 #define MAJOR_SATA2 260 /* high SATA disk partitions (Block Extended Major) (obsolete) */