Bug 9031

Summary: [PATCH] init: open /dev/console on FreeBSD
Product: Busybox Reporter: Jon Boden <jon>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.22.x   
Target Milestone: ---   
Hardware: All   
OS: Other   
Host: Target:
Build:
Attachments: patch for init on FreeBSD

Description Jon Boden 2016-06-20 07:02:16 UTC
Created attachment 6496 [details]
patch for init on FreeBSD

FreeBSD doesn't tell PID 1 the pathname of /dev/console through CONSOLE environment variable like Linux does. Instead it expects PID 1 to always open /dev/console.

This patch is tested on ubuntuBSD but I think it should work on FreeBSD too (I haven't tested the whole init yet, just verified that with my patch it can print to stdout).
Comment 1 Jon Boden 2016-06-20 15:02:14 UTC
Hi

I've been pointed out that Linux doesn't set the CONSOLE variable unless requested in the kernel command-line. Instead, the default is to attach a handle to /dev/console in fds 0, 1 and 2.

However patch is still needed on FreeBSD, because the FreeBSD kernel does neither of these things.
Comment 2 Denys Vlasenko 2016-08-22 18:57:41 UTC
Fixed in git.