Bug 9031 - [PATCH] init: open /dev/console on FreeBSD
Summary: [PATCH] init: open /dev/console on FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.22.x
Hardware: All Other
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 07:02 UTC by Jon Boden
Modified: 2016-08-22 18:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
patch for init on FreeBSD (630 bytes, patch)
2016-06-20 07:02 UTC, Jon Boden
Details

Note You need to log in before you can comment on or make changes to this bug.
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.