[RFC] MACHINE vs MACHINE_ARCH in login/loader messages : should gettytab use %p instead of %m?

"Haowu Ge(葛豪武)" <[email protected]> Sun, 24 May 2026 18:45:52 +0800
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <[email protected]>
Hello everyone,

I'm currently trying to port FreeBSD to loongarch64, and during the process I noticed something about the MACHINE/MACHINE_ARCH values — though I'm not entirely sure it's an actual problem.

I initially found the descriptions of -m and -p in the uname man page, and thought -p should be broader in scope. But after reading the discussion at https://reviews.freebsd.org/D35962, I no longer think that's an issue — the current values make sense:

MACHINE = loongarch
MACHINE_ARCH = loongarch64

Reference:
'''
-m      Write the type of the current hardware platform to standard
             output.  (make(1) uses it to set the MACHINE variable.)
-p      Write the type of the machine processor architecture to standard
             output.  (make(1) uses it to set the MACHINE_ARCH variable.)
...
EXAMPLES
     The hardware platform (-m) can be different from the machine's processor
     architecture (-p), e.g., on 64-bit PowerPC, -m would return powerpc and
     -p would return powerpc64.
'''

That said, since -m and -p are clearly distinct and will not be changed, I looked at libexec/getty/gettytab and noticed it uses %m instead of %p. Would it make more sense to use %p here?

'''
 32 #             2. set cs8 -parenb -istrip -inpck.
 33 #     ep:op:  same as ap.
 34 #
 35 default:\
 36         :cb:ce:ck:lc:fd#1000:im=\r\n%s/%m (%h) (%t)\r\n\r\n:sp#1200:\
 37         :if=/etc/issue:
 38
 39 #
 40 # Fixed speed entries

Fri Nov 28 03:28:18 UTC 2025
FreeBSD/riscv (generic) (ttyu0)
login: 

Consoles: EFI console  
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p3:
FreeBSD/riscv EFI loader, Revision 3.0
'''

Would "riscv64" be more appropriate in both cases?
loongarch64 has the same issue, so I'd like to hear your thoughts. Thanks.


Thanks & Best Regards
👨‍💻 Haowu Ge (葛豪武) | 📡 BG5FRG | 🔐 0xDF09D8A8 | 🌐 www.gehaowu.com