Temporary fix for virt-manager PTY CRLF
This commit is contained in:
parent
c8fb0f76d8
commit
da0d1f3d6e
@ -102,7 +102,7 @@ condition = { files_modified = { input = [
|
||||
# This will not depend on *every* binary we build.
|
||||
# If we mount a disk later in boot we can store other binaries there.
|
||||
"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"]
|
||||
script = '''
|
||||
mkdir -p build/initramfs/system/bin
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2025 shibedrill
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
use crate::constants::NEWLINE;
|
||||
use crate::format;
|
||||
use crate::memory::alloc::string::String;
|
||||
use crate::{LOGGER, LogLevel, log_trace};
|
||||
@ -26,7 +27,8 @@ lazy_static! {
|
||||
|
||||
pub fn log_modules() {
|
||||
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() {
|
||||
log_msg.push_str(&format!(
|
||||
"\t{}",
|
||||
|
@ -8,6 +8,8 @@ use crate::format;
|
||||
use crate::log::LogLevel;
|
||||
use crate::memory::alloc::string::String;
|
||||
|
||||
pub static NEWLINE: &str = "\r\n";
|
||||
|
||||
#[bitflags]
|
||||
#[repr(u8)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
use core::fmt::Write;
|
||||
|
||||
use crate::constants::LOG_DEFAULT_LEVEL;
|
||||
use crate::constants::{LOG_DEFAULT_LEVEL, NEWLINE};
|
||||
use crate::memory::alloc;
|
||||
use alloc::boxed::*;
|
||||
use alloc::string::*;
|
||||
@ -107,9 +107,9 @@ impl LoggerInner {
|
||||
let level_string = String::from(level);
|
||||
for sub in &self.subscriber {
|
||||
let mut message = String::new();
|
||||
writeln!(
|
||||
write!(
|
||||
&mut message,
|
||||
"[{level_string}] {file}:{line},{column} - {msg}"
|
||||
"[{level_string}] {file}:{line},{column} - {msg}{NEWLINE}"
|
||||
)
|
||||
.unwrap();
|
||||
sub.lock().log_write(&message);
|
||||
|
@ -1,18 +1,17 @@
|
||||
// Copyright (c) 2025 shibedrill
|
||||
// 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 alloc::string::String;
|
||||
use core::pin::*;
|
||||
use lazy_static::lazy_static;
|
||||
use limine::{
|
||||
memory_map::EntryType,
|
||||
request::{ExecutableAddressRequest, HhdmRequest, MemoryMapRequest, PagingModeRequest},
|
||||
response::HhdmResponse,
|
||||
};
|
||||
use spin::Mutex;
|
||||
use core::pin::*;
|
||||
use crate::memory::alloc::boxed::Box;
|
||||
use talc::*;
|
||||
|
||||
pub extern crate alloc;
|
||||
@ -24,9 +23,7 @@ pub struct FreeFrameBlockList {
|
||||
impl FreeFrameBlockList {
|
||||
pub fn push(&mut self) {
|
||||
if let Some(inner) = &self.head {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -41,8 +38,12 @@ pub struct FreeFrameBlock {
|
||||
}
|
||||
|
||||
impl FreeFrameBlock {
|
||||
fn num_frames(&self) -> usize { self.num_frames }
|
||||
fn next_block(&self) -> &Option<Pin<Box<FreeFrameBlock>>> { &self.next_block }
|
||||
fn num_frames(&self) -> usize {
|
||||
self.num_frames
|
||||
}
|
||||
fn next_block(&self) -> &Option<Pin<Box<FreeFrameBlock>>> {
|
||||
&self.next_block
|
||||
}
|
||||
}
|
||||
|
||||
pub fn log_memory() {
|
||||
@ -59,7 +60,7 @@ pub fn log_memory() {
|
||||
let mut unusable: u64 = 0;
|
||||
for entry in mmap_response.entries() {
|
||||
log_msg.push_str(&format!(
|
||||
"\n\t0x{:X} bytes @ 0x{:X}: {}",
|
||||
"{NEWLINE}\t0x{:X} bytes @ 0x{:X}: {}",
|
||||
entry.length,
|
||||
entry.base,
|
||||
match entry.entry_type {
|
||||
@ -103,13 +104,7 @@ pub fn log_memory() {
|
||||
log_trace!("{log_msg}");
|
||||
let total = usable + reclaimable + hardware + unusable;
|
||||
log_info!(
|
||||
"Boot: Memory report:
|
||||
Free: 0x{usable:X}
|
||||
Available: 0x{reclaimable:X}
|
||||
Usable: 0x{:X}
|
||||
Hardware: 0x{hardware:X}
|
||||
Unusable: 0x{unusable:X}
|
||||
Total: 0x{total:X}",
|
||||
"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}",
|
||||
usable + reclaimable,
|
||||
);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user