Temporary fix for virt-manager PTY CRLF

This commit is contained in:
August 2025-09-29 23:26:52 -04:00
parent c8fb0f76d8
commit da0d1f3d6e
Signed by: shibedrill
GPG Key ID: 5FE0CB25945EFAA2
5 changed files with 20 additions and 21 deletions

View File

@ -102,7 +102,7 @@ condition = { files_modified = { input = [
# This will not depend on *every* binary we build. # This will not depend on *every* binary we build.
# If we mount a disk later in boot we can store other binaries there. # If we mount a disk later in boot we can store other binaries there.
"configs/server_config.toml" "configs/server_config.toml"
], output = ["build/initramfs.tar.lzma"] }, fail_message = "(inputs unchanged)" } ], output = ["build/${ARCH}/initramfs.tar.lzma"] }, fail_message = "(inputs unchanged)" }
dependencies = ["bins"] dependencies = ["bins"]
script = ''' script = '''
mkdir -p build/initramfs/system/bin mkdir -p build/initramfs/system/bin

View File

@ -1,6 +1,7 @@
// Copyright (c) 2025 shibedrill // Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
use crate::constants::NEWLINE;
use crate::format; use crate::format;
use crate::memory::alloc::string::String; use crate::memory::alloc::string::String;
use crate::{LOGGER, LogLevel, log_trace}; use crate::{LOGGER, LogLevel, log_trace};
@ -26,7 +27,8 @@ lazy_static! {
pub fn log_modules() { pub fn log_modules() {
if !MODULE_RESPONSE.modules().is_empty() { if !MODULE_RESPONSE.modules().is_empty() {
let mut log_msg: String = String::from("Kernel modules list:\n"); let mut log_msg: String = String::from("Kernel modules list:");
log_msg.push_str(NEWLINE);
for module in MODULE_RESPONSE.modules() { for module in MODULE_RESPONSE.modules() {
log_msg.push_str(&format!( log_msg.push_str(&format!(
"\t{}", "\t{}",

View File

@ -8,6 +8,8 @@ use crate::format;
use crate::log::LogLevel; use crate::log::LogLevel;
use crate::memory::alloc::string::String; use crate::memory::alloc::string::String;
pub static NEWLINE: &str = "\r\n";
#[bitflags] #[bitflags]
#[repr(u8)] #[repr(u8)]
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]

View File

@ -3,7 +3,7 @@
use core::fmt::Write; use core::fmt::Write;
use crate::constants::LOG_DEFAULT_LEVEL; use crate::constants::{LOG_DEFAULT_LEVEL, NEWLINE};
use crate::memory::alloc; use crate::memory::alloc;
use alloc::boxed::*; use alloc::boxed::*;
use alloc::string::*; use alloc::string::*;
@ -107,9 +107,9 @@ impl LoggerInner {
let level_string = String::from(level); let level_string = String::from(level);
for sub in &self.subscriber { for sub in &self.subscriber {
let mut message = String::new(); let mut message = String::new();
writeln!( write!(
&mut message, &mut message,
"[{level_string}] {file}:{line},{column} - {msg}" "[{level_string}] {file}:{line},{column} - {msg}{NEWLINE}"
) )
.unwrap(); .unwrap();
sub.lock().log_write(&message); sub.lock().log_write(&message);

View File

@ -1,18 +1,17 @@
// Copyright (c) 2025 shibedrill // Copyright (c) 2025 shibedrill
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
use crate::constants::NEWLINE;
use crate::memory::alloc::boxed::Box;
use crate::{LOGGER, LogLevel, format, log_info, log_trace}; use crate::{LOGGER, LogLevel, format, log_info, log_trace};
use alloc::string::String; use alloc::string::String;
use core::pin::*;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use limine::{ use limine::{
memory_map::EntryType, memory_map::EntryType,
request::{ExecutableAddressRequest, HhdmRequest, MemoryMapRequest, PagingModeRequest}, request::{ExecutableAddressRequest, HhdmRequest, MemoryMapRequest, PagingModeRequest},
response::HhdmResponse, response::HhdmResponse,
}; };
use spin::Mutex;
use core::pin::*;
use crate::memory::alloc::boxed::Box;
use talc::*; use talc::*;
pub extern crate alloc; pub extern crate alloc;
@ -24,9 +23,7 @@ pub struct FreeFrameBlockList {
impl FreeFrameBlockList { impl FreeFrameBlockList {
pub fn push(&mut self) { pub fn push(&mut self) {
if let Some(inner) = &self.head { if let Some(inner) = &self.head {
} else { } else {
} }
} }
} }
@ -41,8 +38,12 @@ pub struct FreeFrameBlock {
} }
impl FreeFrameBlock { impl FreeFrameBlock {
fn num_frames(&self) -> usize { self.num_frames } fn num_frames(&self) -> usize {
fn next_block(&self) -> &Option<Pin<Box<FreeFrameBlock>>> { &self.next_block } self.num_frames
}
fn next_block(&self) -> &Option<Pin<Box<FreeFrameBlock>>> {
&self.next_block
}
} }
pub fn log_memory() { pub fn log_memory() {
@ -59,7 +60,7 @@ pub fn log_memory() {
let mut unusable: u64 = 0; let mut unusable: u64 = 0;
for entry in mmap_response.entries() { for entry in mmap_response.entries() {
log_msg.push_str(&format!( log_msg.push_str(&format!(
"\n\t0x{:X} bytes @ 0x{:X}: {}", "{NEWLINE}\t0x{:X} bytes @ 0x{:X}: {}",
entry.length, entry.length,
entry.base, entry.base,
match entry.entry_type { match entry.entry_type {
@ -103,13 +104,7 @@ pub fn log_memory() {
log_trace!("{log_msg}"); log_trace!("{log_msg}");
let total = usable + reclaimable + hardware + unusable; let total = usable + reclaimable + hardware + unusable;
log_info!( log_info!(
"Boot: Memory report: "Boot: Memory report: {NEWLINE}\tFree: 0x{usable:X}{NEWLINE}\tAvailable: 0x{reclaimable:X}{NEWLINE}\tUsable: 0x{:X}{NEWLINE}\tHardware: 0x{hardware:X}{NEWLINE}\tUnusable: 0x{unusable:X}{NEWLINE}\tTotal: 0x{total:X}",
Free: 0x{usable:X}
Available: 0x{reclaimable:X}
Usable: 0x{:X}
Hardware: 0x{hardware:X}
Unusable: 0x{unusable:X}
Total: 0x{total:X}",
usable + reclaimable, usable + reclaimable,
); );
} else { } else {