40ba2caaf6
Graceful init patches for fbcond, graphics scheme, smolnetd, vesad, PCI interrupt allocation, BAR probing, common init, inputd fallback, and dhcpd hard dependency ordering.
88 lines
4.1 KiB
Diff
88 lines
4.1 KiB
Diff
diff --git a/drivers/graphics/driver-graphics/src/lib.rs b/drivers/graphics/driver-graphics/src/lib.rs
|
|
index b6683686..cd064ae6 100644
|
|
--- a/drivers/graphics/driver-graphics/src/lib.rs
|
|
+++ b/drivers/graphics/driver-graphics/src/lib.rs
|
|
@@ -133 +133 @@ pub struct GraphicsScheme<T: GraphicsAdapter> {
|
|
- inputd_handle: DisplayHandle,
|
|
+ inputd_handle: Option<DisplayHandle>,
|
|
@@ -187,6 +187 @@ impl<T: GraphicsAdapter> GraphicsScheme<T> {
|
|
- DisplayHandle::new_early(&inner.scheme_name).map_err(|e| {
|
|
- io::Error::new(
|
|
- io::ErrorKind::Other,
|
|
- format!("failed to create early display handle: {e}"),
|
|
- )
|
|
- })?
|
|
+ DisplayHandle::new_early(&inner.scheme_name)
|
|
@@ -194,6 +189,13 @@ impl<T: GraphicsAdapter> GraphicsScheme<T> {
|
|
- DisplayHandle::new(&inner.scheme_name).map_err(|e| {
|
|
- io::Error::new(
|
|
- io::ErrorKind::Other,
|
|
- format!("failed to create display handle: {e}"),
|
|
- )
|
|
- })?
|
|
+ DisplayHandle::new(&inner.scheme_name)
|
|
+ };
|
|
+
|
|
+ let inputd_handle = match display_handle {
|
|
+ Ok(handle) => Some(handle),
|
|
+ Err(err) => {
|
|
+ log::warn!(
|
|
+ "{}: display input handle unavailable ({}), continuing without VT input",
|
|
+ inner.scheme_name,
|
|
+ err
|
|
+ );
|
|
+ None
|
|
+ }
|
|
@@ -204 +206 @@ impl<T: GraphicsAdapter> GraphicsScheme<T> {
|
|
- inputd_handle: display_handle,
|
|
+ inputd_handle,
|
|
@@ -213,2 +215,2 @@ impl<T: GraphicsAdapter> GraphicsScheme<T> {
|
|
- pub fn inputd_event_handle(&self) -> BorrowedFd<'_> {
|
|
- self.inputd_handle.inner()
|
|
+ pub fn inputd_event_handle(&self) -> Option<BorrowedFd<'_>> {
|
|
+ self.inputd_handle.as_ref().map(|h| h.inner())
|
|
@@ -238,2 +240,5 @@ impl<T: GraphicsAdapter> GraphicsScheme<T> {
|
|
- while let Some(vt_event) = self
|
|
- .inputd_handle
|
|
+ let inputd_handle = match self.inputd_handle.as_mut() {
|
|
+ Some(h) => h,
|
|
+ None => return,
|
|
+ };
|
|
+ while let Some(vt_event) = inputd_handle
|
|
|
|
diff --git a/drivers/graphics/ihdgd/src/main.rs b/drivers/graphics/ihdgd/src/main.rs
|
|
index 4aa21caa..964510f5 100644
|
|
--- a/drivers/graphics/ihdgd/src/main.rs
|
|
+++ b/drivers/graphics/ihdgd/src/main.rs
|
|
@@ -65,0 +66 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
|
|
+ if let Some(inputd_fd) = scheme.inputd_event_handle() {
|
|
@@ -68 +69 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
|
|
- scheme.inputd_event_handle().as_raw_fd() as usize,
|
|
+ inputd_fd.as_raw_fd() as usize,
|
|
@@ -72,0 +74 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
|
|
+ }
|
|
|
|
diff --git a/drivers/graphics/vesad/src/main.rs b/drivers/graphics/vesad/src/main.rs
|
|
index 6f55913b..c19629aa 100644
|
|
--- a/drivers/graphics/vesad/src/main.rs
|
|
+++ b/drivers/graphics/vesad/src/main.rs
|
|
@@ -163,0 +164 @@ fn daemon(daemon: daemon::Daemon) -> ! {
|
|
+ if let Some(inputd_fd) = scheme.inputd_event_handle() {
|
|
@@ -165 +166 @@ fn daemon(daemon: daemon::Daemon) -> ! {
|
|
- scheme.inputd_event_handle().as_raw_fd() as usize,
|
|
+ inputd_fd.as_raw_fd() as usize,
|
|
@@ -172,0 +174 @@ fn daemon(daemon: daemon::Daemon) -> ! {
|
|
+ }
|
|
|
|
diff --git a/drivers/graphics/virtio-gpud/src/main.rs b/drivers/graphics/virtio-gpud/src/main.rs
|
|
index b27f4c56..3aa41c74 100644
|
|
--- a/drivers/graphics/virtio-gpud/src/main.rs
|
|
+++ b/drivers/graphics/virtio-gpud/src/main.rs
|
|
@@ -552,0 +553 @@ fn deamon(deamon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> anyhow:
|
|
+ if let Some(inputd_fd) = scheme.inputd_event_handle() {
|
|
@@ -555 +556 @@ fn deamon(deamon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> anyhow:
|
|
- scheme.inputd_event_handle().as_raw_fd() as usize,
|
|
+ inputd_fd.as_raw_fd() as usize,
|
|
@@ -559,0 +561 @@ fn deamon(deamon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> anyhow:
|
|
+ }
|