diff options
author | Warner Losh <imp@FreeBSD.org> | 2020-02-23 23:36:56 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2020-02-23 23:36:56 +0000 |
commit | 9bcb741864b96be4bf4cf6b2a1afd2d6a9221c98 (patch) | |
tree | 3b11bed85e622187c637cbaf08317eec10f8d0a9 /usr.sbin/config | |
parent | 97b116ad0ae64a9c0f79a4a5c33fd6905f5ca6e1 (diff) | |
download | src-test2-9bcb741864b96be4bf4cf6b2a1afd2d6a9221c98.tar.gz src-test2-9bcb741864b96be4bf4cf6b2a1afd2d6a9221c98.zip |
Notes
Diffstat (limited to 'usr.sbin/config')
-rw-r--r-- | usr.sbin/config/config.5 | 3 | ||||
-rw-r--r-- | usr.sbin/config/config.y | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/config/config.5 b/usr.sbin/config/config.5 index dc8bdeb86eca..fdcbb1399ed5 100644 --- a/usr.sbin/config/config.5 +++ b/usr.sbin/config/config.5 @@ -283,7 +283,8 @@ corresponds to MACHINE_ARCH. .Pp A kernel configuration file may have only one .Ic machine -directive. +directive, unless the second one matches the +machine argument in the first one exactly. .\" -------- MAKEOPTION -------- .Pp .It Ic makeoption Ar options diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index e6504500454b..6fcd93aa19f9 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -155,8 +155,11 @@ Config_spec: machinearch = $2; } | ARCH Save_id Save_id { - if (machinename != NULL && - !(eq($2, machinename) && eq($3, machinearch))) + /* + * Allow the machinearch to change with a second machine directive, + * but still enforce no changes to the machinename. + */ + if (machinename != NULL && !eq($2, machinename)) errx(1, "%s:%d: only one machine directive is allowed", yyfile, yyline); machinename = $2; |