NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/59374: KERNEL_DIR: support passing directories from 'boot'
The following reply was made to PR kern/59374; it has been noted by GNATS.
From: Paul Goyette <paul%whooppee.com@localhost>
To: Christos Zoulas <christos%zoulas.com@localhost>
Cc: gnats-bugs%netbsd.org@localhost, kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost, Thomas Klausner <wiz%NetBSD.org@localhost>
Subject: Re: kern/59374: KERNEL_DIR: support passing directories from 'boot'
Date: Mon, 28 Apr 2025 14:38:16 -0700 (PDT)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--0-1273842014-1745876296=:22606
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
On Mon, 28 Apr 2025, Christos Zoulas wrote:
> Perhaps:
Looks good - please go ahead and commit. Or let me knnow if I
should do it.
> RCS file: /cvsroot/src/sys/arch/i386/stand/boot/boot2.c,v
> retrieving revision 1.80
> diff -u -p -u -r1.80 boot2.c
> --- boot2.c 26 Apr 2025 20:17:36 -0000 1.80
> +++ boot2.c 28 Apr 2025 20:47:31 -0000
> @@ -126,6 +126,7 @@ static const char *default_part_name;
>
> char *sprint_bootsel(const char *);
> static void bootit(const char *, int);
> +static void bootit2(const char *, size_t, int);
> void boot2(int, uint64_t);
>
> void command_help(char *);
> @@ -473,6 +474,14 @@ command_quit(char *arg)
> panic("Could not reboot!");
> }
>
> +static void
> +bootit2(char *path, size_t plen, int howto)
> +{
> + bootit(path, howto);
> + snprintf(path, plen, "%s.gz", path);
> + bootit(path, howto | AB_VERBOSE);
> +}
> +
> void
> command_boot(char *arg)
> {
> @@ -483,7 +492,13 @@ command_boot(char *arg)
> return;
>
> if (filename !=3D NULL) {
> - bootit(filename, howto);
> + char path[512];
> + if (strchr(filename, '/') =3D=3D NULL) {
> + snprintf(path, sizeof(path}, "%s/kernel", filenam=
e);
> + bootit2(path, sizeof(path), howto);
> + }
> + snprintf(path, sizeof(path}, "%s", filename);
> + bootit2(path, sizeof(path), howto);
> } else {
> int i;
>
>
>
>> On Apr 28, 2025, at 4:20=E2=80=AFPM, Paul Goyette via gnats <gnats-admin=
@netbsd.org> wrote:
>>
>> The following reply was made to PR kern/59374; it has been noted by GNAT=
S.
>>
>> From: Paul Goyette <paul%whooppee.com@localhost>
>> To: Christos Zoulas <christos%zoulas.com@localhost>
>> Cc: gnats-bugs%netbsd.org@localhost, kern-bug-people%netbsd.org@localhost, gnats-admin@netbs=
d.org,
>> netbsd-bugs%netbsd.org@localhost
>> Subject: Re: kern/59374: KERNEL_DIR: support passing directories from 'b=
oot'
>> Date: Mon, 28 Apr 2025 13:18:08 -0700 (PDT)
>>
>> On Mon, 28 Apr 2025, Paul Goyette wrote:
>>
>>> On Mon, 28 Apr 2025, Christos Zoulas wrote:
>>>
>>>> Not easy to do because it can't simply stat the name because we are
>>>> accessing the disks using bios. The best we can do is probably
>>>> try name/kernel, name/kernel.gz and then try name.
>>>
>>> That sounds workable.
>>
>> Does this work for you?
>>
>> Index: boot2.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> RCS file: /cvsroot/src/sys/arch/i386/stand/boot/boot2.c,v
>> retrieving revision 1.80
>> diff -u -p -r1.80 boot2.c
>> --- boot2.c=0926 Apr 2025 20:17:36 -0000=091.80
>> +++ boot2.c=0928 Apr 2025 20:16:01 -0000
>> @@ -477,13 +477,34 @@ void
>> command_boot(char *arg)
>> {
>> =09char *filename;
>> +=09char path[512];
>> =09int howto;
>>
>> =09if (!parseboot(arg, &filename, &howto))
>> =09=09return;
>>
>> =09if (filename !=3D NULL) {
>> -=09=09bootit(filename, howto);
>> +=09=09if ((strrchr(filename, '/') =3D=3D '\0') {
>> +
>> +=09=09=09/* filename/kernel */
>> +=09=09=09strcpy(path, filename);
>> +=09=09=09strcat(path, "/kernel");
>> +=09=09=09bootit(path, howto);
>> +
>> +=09=09=09/* filename/kernel.gz */
>> +=09=09=09strcat(path, ".gz");
>> +=09=09=09bootit(path, howto || AB_VERBOSE);
>> +
>> +=09=09=09/* filename */
>> +=09=09=09bootit(filename, howto);
>> +
>> +=09=09=09/* filename.gz */
>> +=09=09=09strcpy(path, filename);
>> +=09=09=09strcat(path, ".gz");
>> +=09=09=09bootit(path, howto || AB_VERBOSE);
>> +
>> +=09=09} else
>> +=09=09=09bootit(filename, howto);
>> =09} else {
>> =09=09int i;
>>
>>
>> +---------------------+--------------------------+----------------------=
+
>> | Paul Goyette (.sig) | PGP Key fingerprint: | E-mail addresses: =
|
>> | (Retired) | 1B11 1849 721C 56C8 F63A | paul%whooppee.com@localhost =
|
>> | Software Developer | 6E2E 05FD 15CE 9F2D 5102 | pgoyette%netbsd.org@localhost =
|
>> | & Network Engineer | | pgoyette99%gmail.com@localhost =
|
>> +---------------------+--------------------------+----------------------=
+
>>
>
>
+---------------------+--------------------------+----------------------+
| Paul Goyette (.sig) | PGP Key fingerprint: | E-mail addresses: |
| (Retired) | 1B11 1849 721C 56C8 F63A | paul%whooppee.com@localhost |
| Software Developer | 6E2E 05FD 15CE 9F2D 5102 | pgoyette%netbsd.org@localhost |
| & Network Engineer | | pgoyette99%gmail.com@localhost |
+---------------------+--------------------------+----------------------+
--0-1273842014-1745876296=:22606--
Home |
Main Index |
Thread Index |
Old Index