Posted on

Linux basic initramfs

With a compiled kernel image, it can be useful to load your own initramfs:

  • make it as small as possible considering the features you need
  • create a minimal test environment for the kernel image
  • mount a remote filesystem as the root
  • your own reason

Anyways, with the official documentation help, let's create an initramfs.

Tool compilation

We need to gen_init_cpio tool that can found in the kernel repository:

gen_init_cpio.c needs to be compiled:

wget -O gen_init_cpio.c 'https://raw.githubusercontent.com/torvalds/linux/v6.7/usr/gen_init_cpio.c'
gcc -o gen_init_cpio gen_init_cpio.c

Now it is ready for use.

Init hello world

Let's create an hello world init program that the kernel can execute to show that everything works correctly:

printf '%s\n' '#include <stdio.h>' '#include <unistd.h>' 'int main() { printf("Hello world!\n"); sleep(999999999); }' | gcc -fpic -static -xc - -o init

Basic Initramfs

Here is a basic initramfs description, we give it to gen_init_cpio directly:

./gen_init_cpio -t 0 -c - > initramfs.cpio <<EOF
# this is a file containing newline separated entries that
# describe the files to be included in the initramfs archive:
# # a comment
# file <name> <location> <mode> <uid> <gid> [<hard links>]
# dir <name> <mode> <uid> <gid>
# nod <name> <mode> <uid> <gid> <dev_type> <maj> <min>
# slink <name> <target> <mode> <uid> <gid>
# pipe <name> <mode> <uid> <gid>
# sock <name> <mode> <uid> <gid>

# Root directory
dir . 1755 0 0

# common directories
dir proc 1775 0 0
dir dev 1775 0 0
dir bin 1775 0 0
dir sys 1775 0 0
dir run 1775 0 0
dir mnt 1775 0 0
dir etc 1775 0 0

# symlink /sbin -> /bin
slink bin /sbin 1744 0 0

# common devices
dir dev/pts 1775 0 0
dir dev/shm 1775 0 0
dir dev/udev 1775 0 0
nod dev/zero 1666 0 0 c 1 5
nod dev/null 1666 0 0 c 1 3
nod dev/console 1622 0 0 c 5 1
nod dev/loop0 1644 0 0 b 7 0
nod dev/ttyS0 1666 0 0 c 4 64
nod dev/tty 1666 0 0 c 5 0
nod dev/ptmx 1666 0 0 c 5 2
nod dev/random 1444 0 0 c 1 8
nod dev/urandom 1444 0 0 c 1 9
slink dev/core /proc/kcore 1777 0 0
slink dev/fd /proc/self/fd 1777 0 0
slink dev/stdout /proc/self/fd/1 1777 0 0
slink dev/stdin /proc/self/fd/0 1777 0 0
slink dev/stderr /proc/self/fd/2 1777 0 0

# include previously compiled init
# make sure the path is /init
file /init init 0755 0 0
EOF

The line starting with file takes an external file as a second parameter, and that's how we include the init program in the archive.

Note this is rootless, we don't need to re-create the filesystem tree locally or use fakeroot to create special file in the archive.

If you're following along, you now have created initramfs.cpio archive!

Test with Qemu

With our initramfs we just need a linux kernel to be able to run it in qemu:

qemu-system-${HOSTTYPE} -kernel vmlinuz-6.7.5-060705-generic -initrd initramfs.cpio -append "console=ttyS0" -cpu max -m 128M -nographic -serial mon:stdio -nodefaults # Press CTRL+a CTRL+x to quit qemu

You can find pre-compiled kernel image in ubuntu repository

Qemu output
[    0.000000] Linux version 6.7.5-060705-generic (kernel@kathleen) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-13ubuntu1) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #202402161836 SMP PREEMPT_DYNAMIC Fri Feb 16 19:10:40 UTC 2024
[    0.000000] Command line: console=ttyS0
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Hygon HygonGenuine
[    0.000000]   Centaur CentaurHauls
[    0.000000]   zhaoxin   Shanghai
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x0000000007fdffff] usable
[    0.000000] BIOS-e820: [mem 0x0000000007fe0000-0x0000000007ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] APIC: Static calls initialized
[    0.000000] SMBIOS 2.8 present.
[    0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 1991.977 MHz processor
[    0.012976] AGP: No AGP bridge found
[    0.013376] last_pfn = 0x7fe0 max_arch_pfn = 0x10000000000
[    0.014585] MTRR map: 4 entries (3 fixed + 1 variable; max 19), built from 8 variable MTRRs
[    0.014969] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT
[    0.046182] found SMP MP-table at [mem 0x000f5ba0-0x000f5baf]
[    0.048966] Using GB pages for direct mapping
[    0.055323] RAMDISK: [mem 0x07f03000-0x07fdffff]
[    0.056335] ACPI: Early table checksum verification disabled
[    0.057050] ACPI: RSDP 0x00000000000F59E0 000014 (v00 BOCHS )
[    0.057572] ACPI: RSDT 0x0000000007FE189C 000034 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.058711] ACPI: FACP 0x0000000007FE1750 000074 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.059919] ACPI: DSDT 0x0000000007FE0040 001710 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.060098] ACPI: FACS 0x0000000007FE0000 000040
[    0.060224] ACPI: APIC 0x0000000007FE17C4 000078 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.060300] ACPI: HPET 0x0000000007FE183C 000038 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.060368] ACPI: WAET 0x0000000007FE1874 000028 (v01 BOCHS  BXPC     00000001 BXPC 00000001)
[    0.060565] ACPI: Reserving FACP table memory at [mem 0x7fe1750-0x7fe17c3]
[    0.060606] ACPI: Reserving DSDT table memory at [mem 0x7fe0040-0x7fe174f]
[    0.060625] ACPI: Reserving FACS table memory at [mem 0x7fe0000-0x7fe003f]
[    0.060640] ACPI: Reserving APIC table memory at [mem 0x7fe17c4-0x7fe183b]
[    0.060654] ACPI: Reserving HPET table memory at [mem 0x7fe183c-0x7fe1873]
[    0.060668] ACPI: Reserving WAET table memory at [mem 0x7fe1874-0x7fe189b]
[    0.064875] No NUMA configuration found
[    0.064920] Faking a node at [mem 0x0000000000000000-0x0000000007fdffff]
[    0.066165] NODE_DATA(0) allocated [mem 0x07ed8000-0x07f02fff]
[    0.072800] Zone ranges:
[    0.072856]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.073020]   DMA32    [mem 0x0000000001000000-0x0000000007fdffff]
[    0.073051]   Normal   empty
[    0.073091]   Device   empty
[    0.073122] Movable zone start for each node
[    0.073180] Early memory node ranges
[    0.073229]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.073491]   node   0: [mem 0x0000000000100000-0x0000000007fdffff]
[    0.073835] Initmem setup node 0 [mem 0x0000000000001000-0x0000000007fdffff]
[    0.075689] On node 0, zone DMA: 1 pages in unavailable ranges
[    0.076152] On node 0, zone DMA: 97 pages in unavailable ranges
[    0.077918] On node 0, zone DMA32: 32 pages in unavailable ranges
[    0.078954] ACPI: PM-Timer IO Port: 0x608
[    0.079974] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.081216] IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
[    0.081555] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.082421] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[    0.082601] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.082878] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[    0.082920] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[    0.083522] ACPI: Using ACPI (MADT) for SMP configuration information
[    0.083610] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.084086] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.085383] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.085470] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x0009ffff]
[    0.085524] PM: hibernation: Registered nosave memory: [mem 0x000a0000-0x000effff]
[    0.085542] PM: hibernation: Registered nosave memory: [mem 0x000f0000-0x000fffff]
[    0.085743] [mem 0x08000000-0xfffbffff] available for PCI devices
[    0.085849] Booting paravirtualized kernel on bare hardware
[    0.086334] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[    0.087922] setup_percpu: NR_CPUS:8192 nr_cpumask_bits:1 nr_cpu_ids:1 nr_node_ids:1
[    0.092926] percpu: Embedded 84 pages/cpu s221184 r8192 d114688 u2097152
[    0.096234] Kernel command line: console=ttyS0
[    0.100225] random: crng init done
[    0.100790] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.101020] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.108746] Fallback order for Node 0: 0
[    0.109901] Built 1 zonelists, mobility grouping on.  Total pages: 31968
[    0.109991] Policy zone: DMA32
[    0.111499] mem auto-init: stack:all(zero), heap alloc:on, heap free:off
[    0.111864] AGP: Checking aperture...
[    0.115538] AGP: No AGP bridge found
[    0.125728] Memory: 75800K/130552K available (20480K kernel code, 4395K rwdata, 13416K rodata, 4860K init, 4904K bss, 54548K reserved, 0K cma-reserved)
[    0.148682] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.154969] ftrace: allocating 55956 entries in 219 pages
[    0.284641] ftrace: allocated 219 pages with 6 groups
[    0.304656] Dynamic Preempt: voluntary
[    0.311404] rcu: Preemptible hierarchical RCU implementation.
[    0.311492] rcu:     RCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=1.
[    0.311695]  Trampoline variant of Tasks RCU enabled.
[    0.311718]  Rude variant of Tasks RCU enabled.
[    0.311733]  Tracing variant of Tasks RCU enabled.
[    0.311925] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.311977] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.355084] NR_IRQS: 524544, nr_irqs: 256, preallocated irqs: 16
[    0.371909] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.381659] Console: colour *CGA 80x25
[    0.384571] printk: legacy console [ttyS0] enabled
[    0.408992] ACPI: Core revision 20230628
[    0.419769] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
[    0.428599] APIC: Switch to symmetric I/O mode setup
[    0.437765] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.458230] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x396d26ec348, max_idle_ns: 881590688210 ns
[    0.459585] Calibrating delay loop (skipped), value calculated using timer frequency.. 3983.95 BogoMIPS (lpj=7967908)
[    0.477660] process: using AMD E400 aware idle routine
[    0.485613] Last level iTLB entries: 4KB 512, 2MB 255, 4MB 127
[    0.486334] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
[    0.488708] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.489903] Spectre V2 : Mitigation: Retpolines
[    0.490200] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.490668] Spectre V2 : Spectre v2 / SpectreRSB : Filling RSB on VMEXIT
[    0.493900] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.503749] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.504258] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers'
[    0.504633] x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
[    0.505071] x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers'
[    0.505697] x86/fpu: xstate_offset[3]:  960, xstate_sizes[3]:   64
[    0.507174] x86/fpu: xstate_offset[4]: 1024, xstate_sizes[4]:   64
[    0.507499] x86/fpu: xstate_offset[9]: 2688, xstate_sizes[9]:    8
[    0.507839] x86/fpu: Enabled xstate features 0x21b, context size is 2696 bytes, using 'standard' format.
[    1.244797] Freeing SMP alternatives memory: 44K
[    1.246413] pid_max: default: 32768 minimum: 301
[    1.260335] LSM: initializing lsm=lockdown,capability,landlock,yama,apparmor,integrity
[    1.262490] landlock: Up and running.
[    1.262643] Yama: becoming mindful.
[    1.268883] AppArmor: AppArmor initialized
[    1.276690] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.277173] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.471034] smpboot: CPU0: AMD QEMU TCG CPU version 2.5+ (family: 0xf, model: 0x6b, stepping: 0x1)
[    1.493337] RCU Tasks: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1.
[    1.496794] RCU Tasks Rude: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1.
[    1.498841] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1.
[    1.501189] Performance Events: PMU not available due to virtualization, using software events only.
[    1.505570] signal: max sigframe size: 3632
[    1.511295] rcu: Hierarchical SRCU implementation.
[    1.511818] rcu:     Max phase no-delay instances is 1000.
[    1.531525] NMI watchdog: Perf NMI watchdog permanently disabled
[    1.533974] smp: Bringing up secondary CPUs ...
[    1.540043] smp: Brought up 1 node, 1 CPU
[    1.540581] smpboot: Max logical packages: 1
[    1.541002] smpboot: Total of 1 processors activated (3983.95 BogoMIPS)
[    1.568521] devtmpfs: initialized
[    1.576697] x86/mm: Memory block size: 128MB
[    1.588465] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    1.590461] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    1.596792] pinctrl core: initialized pinctrl subsystem
[    1.616434] PM: RTC time: 08:08:55, date: 2024-02-25
[    1.676104] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    1.688697] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    1.690708] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    1.691724] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    1.692552] audit: initializing netlink subsys (disabled)
[    1.711982] audit: type=2000 audit(1708848534.284:1): state=initialized audit_enabled=0 res=1
[    1.723892] thermal_sys: Registered thermal governor 'fair_share'
[    1.723996] thermal_sys: Registered thermal governor 'bang_bang'
[    1.724330] thermal_sys: Registered thermal governor 'step_wise'
[    1.724604] thermal_sys: Registered thermal governor 'user_space'
[    1.724882] thermal_sys: Registered thermal governor 'power_allocator'
[    1.725522] EISA bus registered
[    1.726649] cpuidle: using governor ladder
[    1.727262] cpuidle: using governor menu
[    1.730711] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    1.736491] PCI: Using configuration type 1 for base access
[    1.751115] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible.
[    1.954677] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[    1.955209] HugeTLB: 16380 KiB vmemmap can be freed for a 1.00 GiB page
[    1.955715] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[    1.956180] HugeTLB: 28 KiB vmemmap can be freed for a 2.00 MiB page
[    2.021166] ACPI: Added _OSI(Module Device)
[    2.021428] ACPI: Added _OSI(Processor Device)
[    2.021604] ACPI: Added _OSI(3.0 _SCP Extensions)
[    2.021772] ACPI: Added _OSI(Processor Aggregator Device)
[    2.083310] ACPI: 1 ACPI AML tables successfully acquired and loaded
[    2.117740] ACPI: _OSC evaluation for CPUs failed, trying _PDC
[    2.122890] ACPI: Interpreter enabled
[    2.125209] ACPI: PM: (supports S0 S3 S4 S5)
[    2.125504] ACPI: Using IOAPIC for interrupt routing
[    2.128480] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    2.128951] PCI: Using E820 reservations for host bridge windows
[    2.132501] ACPI: Enabled 2 GPEs in block 00 to 0F
[    2.199929] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    2.201765] acpi PNP0A03:00: _OSC: OS supports [ASPM ClockPM Segments MSI EDR HPX-Type3]
[    2.202917] acpi PNP0A03:00: _OSC: not requesting OS control; OS requires [ExtendedConfig ASPM ClockPM MSI]
[    2.205890] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended configuration space under this bridge
[    2.228341] acpiphp: Slot [2] registered
[    2.229037] acpiphp: Slot [3] registered
[    2.229525] acpiphp: Slot [4] registered
[    2.229997] acpiphp: Slot [5] registered
[    2.230569] acpiphp: Slot [6] registered
[    2.231184] acpiphp: Slot [7] registered
[    2.231684] acpiphp: Slot [8] registered
[    2.232181] acpiphp: Slot [9] registered
[    2.232653] acpiphp: Slot [10] registered
[    2.233121] acpiphp: Slot [11] registered
[    2.233576] acpiphp: Slot [12] registered
[    2.234071] acpiphp: Slot [13] registered
[    2.234859] acpiphp: Slot [14] registered
[    2.235453] acpiphp: Slot [15] registered
[    2.235978] acpiphp: Slot [16] registered
[    2.236453] acpiphp: Slot [17] registered
[    2.236931] acpiphp: Slot [18] registered
[    2.237418] acpiphp: Slot [19] registered
[    2.237899] acpiphp: Slot [20] registered
[    2.238383] acpiphp: Slot [21] registered
[    2.239303] acpiphp: Slot [22] registered
[    2.239806] acpiphp: Slot [23] registered
[    2.240301] acpiphp: Slot [24] registered
[    2.240864] acpiphp: Slot [25] registered
[    2.241343] acpiphp: Slot [26] registered
[    2.241820] acpiphp: Slot [27] registered
[    2.242290] acpiphp: Slot [28] registered
[    2.242765] acpiphp: Slot [29] registered
[    2.243433] acpiphp: Slot [30] registered
[    2.243916] acpiphp: Slot [31] registered
[    2.245038] PCI host bridge to bus 0000:00
[    2.245725] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    2.246466] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    2.246838] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    2.247449] pci_bus 0000:00: root bus resource [mem 0x08000000-0xfebfffff window]
[    2.247845] pci_bus 0000:00: root bus resource [mem 0x100000000-0x17fffffff window]
[    2.248672] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.254081] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000
[    2.284011] pci 0000:00:01.0: [8086:7000] type 00 class 0x060100
[    2.286943] pci 0000:00:01.1: [8086:7010] type 00 class 0x010180
[    2.291425] pci 0000:00:01.1: reg 0x20: [io  0xc000-0xc00f]
[    2.293431] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    2.293999] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    2.294513] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    2.295175] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[    2.297203] pci 0000:00:01.3: [8086:7113] type 00 class 0x068000
[    2.298700] pci 0000:00:01.3: quirk: [io  0x0600-0x063f] claimed by PIIX4 ACPI
[    2.299231] pci 0000:00:01.3: quirk: [io  0x0700-0x070f] claimed by PIIX4 SMB
[    2.318657] ACPI: PCI: Interrupt link LNKA configured for IRQ 10
[    2.322086] ACPI: PCI: Interrupt link LNKB configured for IRQ 10
[    2.325110] ACPI: PCI: Interrupt link LNKC configured for IRQ 11
[    2.328127] ACPI: PCI: Interrupt link LNKD configured for IRQ 11
[    2.329612] ACPI: PCI: Interrupt link LNKS configured for IRQ 9
[    2.339720] iommu: Default domain type: Translated
[    2.340226] iommu: DMA domain TLB invalidation policy: lazy mode
[    2.350798] SCSI subsystem initialized
[    2.356851] ACPI: bus type USB registered
[    2.358179] usbcore: registered new interface driver usbfs
[    2.359597] usbcore: registered new interface driver hub
[    2.360440] usbcore: registered new device driver usb
[    2.361948] pps_core: LinuxPPS API ver. 1 registered
[    2.362305] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    2.363109] PTP clock support registered
[    2.366777] EDAC MC: Ver: 3.0.0
[    2.401484] NetLabel: Initializing
[    2.401856] NetLabel:  domain hash size = 128
[    2.402226] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    2.405856] NetLabel:  unlabeled traffic allowed by default
[    2.417187] mctp: management component transport protocol core
[    2.417759] NET: Registered PF_MCTP protocol family
[    2.419621] PCI: Using ACPI for IRQ routing
[    2.424395] vgaarb: loaded
[    2.432278] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    2.435526] hpet0: 3 comparators, 64-bit 100.000000 MHz counter
[    2.441451] clocksource: Switched to clocksource tsc-early
[    2.479237] VFS: Disk quotas dquot_6.6.0
[    2.479830] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    2.488462] AppArmor: AppArmor Filesystem Enabled
[    2.489459] pnp: PnP ACPI init
[    2.499297] pnp: PnP ACPI: found 5 devices
[    2.554421] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    2.558514] NET: Registered PF_INET protocol family
[    2.560815] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    2.572527] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    2.574110] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    2.575435] TCP established hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    2.576287] TCP bind hash table entries: 1024 (order: 3, 32768 bytes, linear)
[    2.576917] TCP: Hash tables configured (established 1024 bind 1024)
[    2.580590] MPTCP token hash table entries: 256 (order: 0, 6144 bytes, linear)
[    2.581587] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    2.582561] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    2.585746] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    2.587105] NET: Registered PF_XDP protocol family
[    2.589514] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    2.589800] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    2.590056] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[    2.590498] pci_bus 0000:00: resource 7 [mem 0x08000000-0xfebfffff window]
[    2.590738] pci_bus 0000:00: resource 8 [mem 0x100000000-0x17fffffff window]
[    2.592801] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    2.593544] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    2.594125] PCI: CLS 0 bytes, default 64
[    2.609597] Trying to unpack rootfs image as initramfs...
[    2.622396] Initialise system trusted keyrings
[    2.625752] Key type blacklist registered
[    2.635394] workingset: timestamp_bits=36 max_order=15 bucket_order=0
[    2.636042] zbud: loaded
[    2.650474] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.653656] fuse: init (API version 7.39)
[    2.667444] integrity: Platform Keyring initialized
[    2.668283] integrity: Machine keyring initialized
[    2.851928] Freeing initrd memory: 884K
[    2.854076] Key type asymmetric registered
[    2.854920] Asymmetric key parser 'x509' registered
[    2.856300] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)
[    2.859177] io scheduler mq-deadline registered
[    2.867237] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[    2.880147] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[    2.893199] ACPI: button: Power Button [PWRF]
[    2.904707] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[    2.939456] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    3.004292] Linux agpgart interface v0.103
[    3.057167] loop: module loaded
[    3.076804] scsi host0: ata_piix
[    3.080516] scsi host1: ata_piix
[    3.081608] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc000 irq 14 lpm-pol 0
[    3.082034] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc008 irq 15 lpm-pol 0
[    3.092255] tun: Universal TUN/TAP device driver, 1.6
[    3.093614] PPP generic driver version 2.4.2
[    3.098935] i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
[    3.105040] serio: i8042 KBD port at 0x60,0x64 irq 1
[    3.105702] serio: i8042 AUX port at 0x60,0x64 irq 12
[    3.108892] mousedev: PS/2 mouse device common for all mice
[    3.115249] rtc_cmos 00:04: RTC can wake from S4
[    3.118543] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
[    3.123392] rtc_cmos 00:04: registered as rtc0
[    3.124604] rtc_cmos 00:04: setting system clock to 2024-02-25T08:08:56 UTC (1708848536)
[    3.127980] rtc_cmos 00:04: alarms up to one day, y3k, 242 bytes nvram, hpet irqs
[    3.128675] i2c_dev: i2c /dev entries driver
[    3.129652] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA log.
[    3.130371] device-mapper: uevent: version 1.0.3
[    3.131881] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[    3.133379] platform eisa.0: Probing EISA bus 0
[    3.133815] platform eisa.0: EISA: Cannot allocate resource for mainboard
[    3.134409] platform eisa.0: Cannot allocate resource for EISA slot 1
[    3.134746] platform eisa.0: Cannot allocate resource for EISA slot 2
[    3.134971] platform eisa.0: Cannot allocate resource for EISA slot 3
[    3.135180] platform eisa.0: Cannot allocate resource for EISA slot 4
[    3.135379] platform eisa.0: Cannot allocate resource for EISA slot 5
[    3.135581] platform eisa.0: Cannot allocate resource for EISA slot 6
[    3.135786] platform eisa.0: Cannot allocate resource for EISA slot 7
[    3.135990] platform eisa.0: Cannot allocate resource for EISA slot 8
[    3.136224] platform eisa.0: EISA: Detected 0 cards
[    3.136667] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled
[    3.137521] ledtrig-cpu: registered to indicate activity on CPUs
[    3.139859] drop_monitor: Initializing network drop monitor service
[    3.340406] NET: Registered PF_INET6 protocol family
[    3.426373] Segment Routing with IPv6
[    3.426373] In-situ OAM (IOAM) with IPv6
[    3.426373] NET: Registered PF_PACKET protocol family
[    3.426373] Key type dns_resolver registered
[    3.445615] IPI shorthand broadcast: enabled
[    3.500293] sched_clock: Marking stable (3448074100, 50141982)->(3882769787, -384553705)
[    3.509332] registered taskstats version 1
[    3.518127] Loading compiled-in X.509 certificates
[    3.564200] Loaded X.509 cert 'Build time autogenerated kernel key: d8cc0cbeff4c741464c5cfe695f218515c617f7b'
[    3.572231] Loaded X.509 cert 'Canonical Ltd. Live Patch Signing: 14df34d1a87cf37625abec039ef2bf521249b969'
[    3.579573] Loaded X.509 cert 'Canonical Ltd. Kernel Module Signing: 88f752e560a1e0737e31163a466ad7b70a850c19'
[    3.580350] blacklist: Loading compiled-in revocation X.509 certificates
[    3.585141] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing: 61482aa2830d0ab2ad5af10b7250da9033ddcef0'
[    3.586553] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2017): 242ade75ac4a15e50d50c84b0d45ff3eae707a03'
[    3.587621] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (ESM 2018): 365188c1d374d6b07c3c8f240f8ef722433d6a8b'
[    3.588597] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2019): c0746fd6c5da3ae827864651ad66ae47fe24b3e8'
[    3.589663] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2021 v1): a8d54bbb3825cfb94fa13c9f8a594a195c107b8d'
[    3.590906] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2021 v2): 4cf046892d6fd3c9a5b03f98d845f90851dc6a8c'
[    3.591908] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (2021 v3): 100437bb6de6e469b581e61cd66bce3ef4ed53af'
[    3.592816] Loaded X.509 cert 'Canonical Ltd. Secure Boot Signing (Ubuntu Core 2019): c1d57b8f6b743f23ee41f4f7ee292f06eecadfb9'
[    3.626555] tsc: Refined TSC clocksource calibration: 1991.985 MHz
[    3.627437] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x396d3638585, max_idle_ns: 881590743307 ns
[    3.628221] clocksource: Switched to clocksource tsc
[    3.676706] Key type .fscrypt registered
[    3.676980] Key type fscrypt-provisioning registered
[    3.697164] Key type encrypted registered
[    3.697670] AppArmor: AppArmor sha1 policy hashing enabled
[    3.699838] ima: No TPM chip found, activating TPM-bypass!
[    3.700478] Loading compiled-in module X.509 certificates
[    3.708570] Loaded X.509 cert 'Build time autogenerated kernel key: d8cc0cbeff4c741464c5cfe695f218515c617f7b'
[    3.709422] ima: Allocated hash algorithm: sha256
[    3.715597] ima: No architecture policies found
[    3.717410] evm: Initialising EVM extended attributes:
[    3.717813] evm: security.selinux
[    3.718101] evm: security.SMACK64
[    3.718506] evm: security.SMACK64EXEC
[    3.718733] evm: security.SMACK64TRANSMUTE
[    3.718979] evm: security.SMACK64MMAP
[    3.719197] evm: security.apparmor
[    3.719395] evm: security.ima
[    3.719585] evm: security.capability
[    3.719856] evm: HMAC attrs: 0x1
[    3.728148] PM:   Magic number: 12:764:119
[    3.732403] powernow_k8: Power state transitions not supported
[    3.917286] RAS: Correctable Errors collector initialized.
[    3.924167] clk: Disabling unused clocks
[    4.045165] Freeing unused decrypted memory: 2028K
[    4.138351] Freeing unused kernel image (initmem) memory: 4860K
[    4.139043] Write protecting the kernel read-only data: 34816k
[    4.142616] Freeing unused kernel image (rodata/data gap) memory: 920K
[    4.606372] x86/mm: Checked W+X mappings: passed, no W+X pages found.
[    4.607434] Run /init as init process
Hello world!

Happy hacking!