概要
wsl(wsl2じゃない)でnervesやってみる。
qemu(x86_64エミュレータ、ラズパイじゃない)でやってみた。
練習問題やってみた。
練習問題
調査せよ。
実行結果
$ ssh -p 10022 localhost
Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
████▄▄ ▐███
█▌ ▀▀██▄▄ ▐█
█▌ ▄▄ ▀▀ ▐█ N E R V E S
█▌ ▀▀██▄▄ ▐█
███▌ ▀▀████
hello_nerves 0.1.0 (b635da3d-e2de-5870-b878-d6d6630f4053) x86_64 x86_64
Uptime : 4 hours, 35 minutes and 17 seconds
Clock : 2023-01-17 08:46:23 UTC
Firmware : Valid (A) Applications : 36 started
Memory usage : 54 MB (48%) Part usage : 0 MB (0%)
Hostname : nerves-3456 Load average : 0.30 0.07 0.02
eth0 : 10.0.2.15/24, fec0::5054:ff:fe12:3456/64, fe80::5054:ff:fe12:3456/64
Nerves CLI help: https://hexdocs.pm/nerves/iex-with-nerves.html
Toolshed imported. Run h(Toolshed) for more info.
iex(1)> uptime
4 hours, 35 minutes and 31 seconds
iex(2)> log_attach
{:ok, #PID<0.1120.0>}
iex(3)> Logger.info("hello")
** (UndefinedFunctionError) function Logger.info/1 is undefined or private. However there is a macro with the same name and arity. Be sure to require Logger if you intend to invoke this macro
(logger 1.13.4) Logger.info("hello")
iex(3)> dmesg
Linux version 5.4.204 (buildroot@buildroot) (gcc version 11.3.0 (crosstool-NG 1.25.0.37_618affc)) #1 SMP PREEMPT Sun Dec 18 19:56:03 UTC 2022
Command line: BOOT_IMAGE=(hd0,msdos2)/boot/bzImage root=PARTUUID=04030201-02 rootwait console=tty1
x86/fpu: x87 FPU will use FXSAVE
BIOS-provided physical RAM map:
BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
BIOS-e820: [mem 0x0000000000100000-0x0000000007fdcfff] usable
BIOS-e820: [mem 0x0000000007fdd000-0x0000000007ffffff] reserved
BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
BIOS-e820: [mem 0x000000fd00000000-0x000000ffffffffff] reserved
NX (Execute Disable) protection: active
SMBIOS 2.8 present.
DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
e820: remove [mem 0x000a0000-0x000fffff] usable
last_pfn = 0x7fdd max_arch_pfn = 0x400000000
MTRR default type: write-back
MTRR fixed ranges enabled:
00000-9FFFF write-back
A0000-BFFFF uncachable
C0000-FFFFF write-protect
MTRR variable ranges enabled:
0 base 0080000000 mask FF80000000 uncachable
1 disabled
2 disabled
3 disabled
4 disabled
5 disabled
6 disabled
7 disabled
x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT
found SMP MP-table at [mem 0x000f5b90-0x000f5b9f]
ACPI: Early table checksum verification disabled
ACPI: RSDP 0x00000000000F59B0 000014 (v00 BOCHS )
ACPI: RSDT 0x0000000007FE18FD 000034 (v01 BOCHS BXPC 00000001 BXPC 00000001)
ACPI: FACP 0x0000000007FE17B1 000074 (v01 BOCHS BXPC 00000001 BXPC 00000001)
ACPI: DSDT 0x0000000007FE0040 001771 (v01 BOCHS BXPC 00000001 BXPC 00000001)
ACPI: FACS 0x0000000007FE0000 000040
ACPI: APIC 0x0000000007FE1825 000078 (v01 BOCHS BXPC 00000001 BXPC 00000001)
ACPI: HPET 0x0000000007FE189D 000038 (v01 BOCHS BXPC 00000001 BXPC 00000001)
ACPI: WAET 0x0000000007FE18D5 000028 (v01 BOCHS BXPC 00000001 BXPC 00000001)
ACPI: Reserving FACP table memory at [mem 0x7fe17b1-0x7fe1824]
ACPI: Reserving DSDT table memory at [mem 0x7fe0040-0x7fe17b0]
ACPI: Reserving FACS table memory at [mem 0x7fe0000-0x7fe003f]
ACPI: Reserving APIC table memory at [mem 0x7fe1825-0x7fe189c]
ACPI: Reserving HPET table memory at [mem 0x7fe189d-0x7fe18d4]
ACPI: Reserving WAET table memory at [mem 0x7fe18d5-0x7fe18fc]
ACPI: Local APIC address 0xfee00000
Zone ranges:
DMA [mem 0x0000000000001000-0x0000000000ffffff]
DMA32 [mem 0x0000000001000000-0x0000000007fdcfff]
Normal empty
Movable zone start for each node
Early memory node ranges
node 0: [mem 0x0000000000001000-0x000000000009efff]
node 0: [mem 0x0000000000100000-0x0000000007fdcfff]
Zeroed struct page in unavailable ranges: 133 pages
Initmem setup node 0 [mem 0x0000000000001000-0x0000000007fdcfff]
On node 0 totalpages: 32635
DMA zone: 64 pages used for memmap
DMA zone: 21 pages reserved
DMA zone: 3998 pages, LIFO batch:0
DMA32 zone: 448 pages used for memmap
DMA32 zone: 28637 pages, LIFO batch:7
ACPI: PM-Timer IO Port: 0x608
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
ACPI: IRQ0 used by override.
ACPI: IRQ5 used by override.
ACPI: IRQ9 used by override.
ACPI: IRQ10 used by override.
ACPI: IRQ11 used by override.
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[mem 0x08000000-0xfffbffff] available for PCI devices
Booting paravirtualized kernel on bare hardware
clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:1 nr_node_ids:1
percpu: Embedded 47 pages/cpu s153304 r8192 d31016 u2097152
pcpu-alloc: s153304 r8192 d31016 u2097152 alloc=1*2097152
pcpu-alloc: [0] 0
Built 1 zonelists, mobility grouping on. Total pages: 32102
Kernel command line: BOOT_IMAGE=(hd0,msdos2)/boot/bzImage root=PARTUUID=04030201-02 rootwait console=tty1
Dentry cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 109496K/130540K available (8195K kernel code, 470K rwdata, 1764K rodata, 948K init, 2320K bss, 21044K reserved, 0K cma-reserved)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
rcu: Preemptible hierarchical RCU implementation.
rcu: RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=1.
Tasks RCU enabled.
rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS: 4352, nr_irqs: 48, preallocated irqs: 16
Console: colour VGA+ 80x25
printk: console [tty1] enabled
ACPI: Core revision 20190816
clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns
APIC: Switch to symmetric I/O mode setup
..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
tsc: Unable to calibrate against PIT
tsc: using HPET reference calibration
tsc: Detected 1090.679 MHz processor
clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0xfb8b432df2, max_idle_ns: 440795230553 ns
Calibrating delay loop (skipped), value calculated using timer frequency.. 2181.35 BogoMIPS (lpj=4362716)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
process: using AMD E400 aware idle routine
Last level iTLB entries: 4KB 512, 2MB 255, 4MB 127
Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
Spectre V2 : Mitigation: Retpolines
Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
Freeing SMP alternatives memory: 24K
smpboot: CPU0: AMD QEMU Virtual CPU version 2.5+ (family: 0xf, model: 0x6b, stepping: 0x1)
Performance Events: PMU not available due to virtualization, using software events only.
rcu: Hierarchical SRCU implementation.
smp: Bringing up secondary CPUs ...
smp: Brought up 1 node, 1 CPU
smpboot: Max logical packages: 1
smpboot: Total of 1 processors activated (2181.35 BogoMIPS)
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
futex hash table entries: 256 (order: 2, 16384 bytes, linear)
NET: Registered protocol family 16
cpuidle: using governor menu
ACPI: bus type PCI registered
PCI: Using configuration type 1 for base access
ACPI: Added _OSI(Module Device)
ACPI: Added _OSI(Processor Device)
ACPI: Added _OSI(3.0 _SCP Extensions)
ACPI: Added _OSI(Processor Aggregator Device)
ACPI: Added _OSI(Linux-Dell-Video)
ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
ACPI: Added _OSI(Linux-HPI-Hybrid-Graphics)
ACPI: 1 ACPI AML tables successfully acquired and loaded
ACPI: Interpreter enabled
ACPI: (supports S0 S3 S5)
ACPI: Using IOAPIC for interrupt routing
PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
ACPI: Enabled 2 GPEs in block 00 to 0F
ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
acpi PNP0A03:00: _OSC: OS supports [Segments HPX-Type3]
acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io 0x0000-0x0cf7 window]
pci_bus 0000:00: root bus resource [io 0x0d00-0xffff window]
pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
pci_bus 0000:00: root bus resource [mem 0x08000000-0xfebfffff window]
pci_bus 0000:00: root bus resource [mem 0x100000000-0x17fffffff window]
pci_bus 0000:00: root bus resource [bus 00-ff]
pci 0000:00:00.0: [8086:1237] type 00 class 0x060000
pci 0000:00:01.0: [8086:7000] type 00 class 0x060100
pci 0000:00:01.1: [8086:7010] type 00 class 0x010180
pci 0000:00:01.1: reg 0x20: [io 0xc0a0-0xc0af]
pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]
pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io 0x03f6]
pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]
pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io 0x0376]
pci 0000:00:01.3: [8086:7113] type 00 class 0x068000
pci 0000:00:01.3: quirk: [io 0x0600-0x063f] claimed by PIIX4 ACPI
pci 0000:00:01.3: quirk: [io 0x0700-0x070f] claimed by PIIX4 SMB
pci 0000:00:02.0: [1234:1111] type 00 class 0x030000
pci 0000:00:02.0: reg 0x10: [mem 0xfd000000-0xfdffffff pref]
pci 0000:00:02.0: reg 0x18: [mem 0xfebd0000-0xfebd0fff]
pci 0000:00:02.0: reg 0x30: [mem 0xfebc0000-0xfebcffff pref]
pci 0000:00:03.0: [1af4:1000] type 00 class 0x020000
pci 0000:00:03.0: reg 0x10: [io 0xc080-0xc09f]
pci 0000:00:03.0: reg 0x14: [mem 0xfebd1000-0xfebd1fff]
pci 0000:00:03.0: reg 0x20: [mem 0xfe000000-0xfe003fff 64bit pref]
pci 0000:00:03.0: reg 0x30: [mem 0xfeb80000-0xfebbffff pref]
pci 0000:00:04.0: [1af4:1001] type 00 class 0x010000
pci 0000:00:04.0: reg 0x10: [io 0xc000-0xc07f]
pci 0000:00:04.0: reg 0x14: [mem 0xfebd2000-0xfebd2fff]
pci 0000:00:04.0: reg 0x20: [mem 0xfe004000-0xfe007fff 64bit pref]
pci_bus 0000:00: on NUMA node 0
ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
pci 0000:00:02.0: vgaarb: setting as boot VGA device
pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
pci 0000:00:02.0: vgaarb: bridge control possible
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
ACPI: bus type USB registered
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Initialized.
PCI: Using ACPI for IRQ routing
PCI: pci_cache_line_size set to 64 bytes
e820: reserve RAM buffer [mem 0x0009fc00-0x0009ffff]
e820: reserve RAM buffer [mem 0x07fdd000-0x07ffffff]
clocksource: Switched to clocksource tsc-early
pnp: PnP ACPI init
pnp 00:00: Plug and Play ACPI device, IDs PNP0303 (active)
pnp 00:01: Plug and Play ACPI device, IDs PNP0f13 (active)
pnp 00:02: [dma 2]
pnp 00:02: Plug and Play ACPI device, IDs PNP0700 (active)
pnp 00:03: Plug and Play ACPI device, IDs PNP0400 (active)
pnp 00:04: Plug and Play ACPI device, IDs PNP0501 (active)
pnp 00:05: Plug and Play ACPI device, IDs PNP0b00 (active)
pnp: PnP ACPI: found 6 devices
thermal_sys: Registered thermal governor 'step_wise'
thermal_sys: Registered thermal governor 'user_space'
clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
pci_bus 0000:00: resource 4 [io 0x0000-0x0cf7 window]
pci_bus 0000:00: resource 5 [io 0x0d00-0xffff window]
pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
pci_bus 0000:00: resource 7 [mem 0x08000000-0xfebfffff window]
pci_bus 0000:00: resource 8 [mem 0x100000000-0x17fffffff window]
NET: Registered protocol family 2
IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
TCP established hash table entries: 1024 (order: 1, 8192 bytes, linear)
TCP bind hash table entries: 1024 (order: 2, 16384 bytes, linear)
TCP: Hash tables configured (established 1024 bind 1024)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered protocol family 1
pci 0000:00:01.0: PIIX3: Enabling Passive Release
pci 0000:00:00.0: Limiting direct PCI/PCI transfers
pci 0000:00:01.0: Activating ISA DMA hang workarounds
pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
PCI: CLS 0 bytes, default 64
workingset: timestamp_bits=62 max_order=15 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler mq-deadline registered
io scheduler kyber registered
input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
ACPI: Power Button [PWRF]
PCI Interrupt Link [LNKC] enabled at IRQ 11
tsc: Refined TSC clocksource calibration: 1094.401 MHz
clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0xfc67048a2b, max_idle_ns: 440795251024 ns
clocksource: Switched to clocksource tsc
PCI Interrupt Link [LNKD] enabled at IRQ 10
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
virtio_blk virtio1: [vda] 1608192 512-byte logical blocks (823 MB/785 MiB)
vda: vda1 vda2 vda3 vda4
hp_sw: device handler registered
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
i8042: PNP: PS/2 Controller [PNP0303:KBD,PNP0f13:MOU] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
intel_powerclamp: CPU does not support MWAIT
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input1
softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=1)
hidraw: raw HID events driver (C) Jiri Kosina
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
Segment Routing with IPv6
NET: Registered protocol family 17
IPI shorthand broadcast: enabled
sched_clock: Marking stable (3754500682, -53396980)->(3824781246, -123677544)
ALSA device list:
No soundcards found.
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input3
VFS: Mounted root (squashfs filesystem) readonly on device 254:2.
devtmpfs: mounted
Freeing unused kernel image memory: 948K
Write protecting the kernel read-only data: 12288k
Freeing unused kernel image memory: 2016K
Freeing unused kernel image memory: 284K
Run /sbin/init as init process
EXT4-fs (vda4): recovery complete
EXT4-fs (vda4): mounted filesystem with ordered data mode. Opts:
ext4 filesystem being mounted at /root supports timestamps until 2038 (0x7fffffff)
heart: nerves_heart v2.0.2 started.
heart: kernel watchdog activated. WDT timeout 60s, WDT pet interval 50s, VM timeout 30s
random: crng init done
clocksource: timekeeping watchdog on CPU0: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU0: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU0: hpet retried 2 times before success
clocksource: timekeeping watchdog on CPU0: Marking clocksource 'tsc' as unstable because the skew is too large:
clocksource: 'hpet' wd_now: dca5aa76 wd_last: 5b3e734c mask: ffffffff
clocksource: 'tsc' cs_now: fe6edb4bceb cs_last: fe669be328a mask: ffffffffffffffff
tsc: Marking TSC unstable due to clocksource watchdog
TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.
sched_clock: Marking unstable (15951947812973, -184401080)<-(15951887089756, -123677544)
clocksource: Switched to clocksource hpet
iex(4)> VintageNet.info
VintageNet 0.12.2
All interfaces: ["eth0", "lo"]
Available interfaces: ["eth0"]
Interface eth0
Type: VintageNetEthernet
Present: true
State: :configured (4:37:13)
Connection: :internet (4:37:05)
Addresses: fec0::5054:ff:fe12:3456/64, 10.0.2.15/24, fe80::5054:ff:fe12:3456/64
MAC Address: "52:54:00:12:34:56"
Configuration:
%{ipv4: %{method: :dhcp}, type: VintageNetEthernet}
Interface usb0
Type: VintageNetDirect
Present: false
Configuration:
%{type: VintageNetDirect}
Interface wlan0
Type: VintageNetWiFi
Present: false
Configuration:
%{type: VintageNetWiFi}
:ok
iex(5)> ifconfig
lo: flags=[:up, :loopback, :running]
inet 127.0.0.1 netmask 255.0.0.0
inet ::1 netmask ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
hwaddr 00:00:00:00:00:00
eth0: flags=[:up, :broadcast, :running, :multicast]
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
inet fec0::5054:ff:fe12:3456 netmask ffff:ffff:ffff:ffff::
inet fe80::5054:ff:fe12:3456 netmask ffff:ffff:ffff:ffff::
hwaddr 52:54:00:12:34:56
iex(6)> cmd("ip route")
default via 10.0.2.2 dev eth0 metric 10
10.0.2.0/24 dev eth0 scope link src 10.0.2.15 metric 10
0
iex(7)> cmd("busybox")
BusyBox v1.35.0 () multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.
Usage: busybox [function [arguments]...]
or: busybox --list
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, [[, ash, brctl, cat, cp, date, dd, df, dmesg, dnsd, env, find, free,
grep, halt, id, ifconfig, ip, ipaddr, iplink, ipneigh, iproute, iprule,
iptunnel, kill, killall, ls, lsmod, mkdir, mknod, modinfo, modprobe,
mount, mv, ntpd, poweroff, ps, pwd, reboot, rm, rmdir, rmmod, sh,
sha256sum, sleep, sysctl, tail, udhcpc, udhcpd, uevent, umount, unzip
0
iex(8)> date
"Tue Jan 17 08:51:30 UTC 2023"
iex(9)> cat "/etc/erlinit.config"
# Generated from rootfs_overlay/etc/erlinit.config
# with overrides from the application config
--hostname-pattern nerves-%s
--ctty tty1
--warn-unused-tty
--env LANG=en_US.UTF-8;LANGUAGE=en;ERL_INETRC=/etc/erl_inetrc;ERL_CRASH_DUMP=/root/crash.dump
--mount /dev/rootdisk0p1:/boot/grub:vfat:ro,nodev,noexec,nosuid:
--mount /dev/rootdisk0p4:/root:ext4:nodev:
--release-path /srv/erlang
--uniqueid-exec /usr/bin/boardid
--boot shoehorn
iex(10)> cat "/etc/shells"
/bin/ash
iex(11)> ls "/boot"
bzImage grub
iex(12)> cat "mix.exs"
** (File.Error) could not read file "mix.exs": no such file or directory
(elixir 1.13.4) lib/file.ex:355: File.read!/1
(toolshed 0.2.26) lib/toolshed/unix.ex:21: Toolshed.Unix.cat/1
iex(12)> ls
erts-13.1.3 lib releases
iex(13)> cat "/proc/cpuinfo"
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 107
model name : QEMU Virtual CPU version 2.5+
stepping : 1
microcode : 0x1000065
cpu MHz : 1090.679
cache size : 512 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl cpuid extd_apicid pni cx16 hypervisor lahf_lm svm 3dnowprefetch vmmcall
bugs : fxsave_leak sysret_ss_attrs null_seg swapgs_fence amd_e400 spectre_v1 spectre_v2
bogomips : 2181.35
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
iex(14)> cat "/proc/meminfo"
MemTotal: 112768 kB
MemFree: 7084 kB
MemAvailable: 30448 kB
Buffers: 10372 kB
Cached: 38064 kB
SwapCached: 0 kB
Active: 53020 kB
Inactive: 37968 kB
Active(anon): 38284 kB
Inactive(anon): 22676 kB
Active(file): 14736 kB
Inactive(file): 15292 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 8 kB
Writeback: 0 kB
AnonPages: 42556 kB
Mapped: 31724 kB
Shmem: 22680 kB
KReclaimable: 2796 kB
Slab: 7316 kB
SReclaimable: 2796 kB
SUnreclaim: 4520 kB
KernelStack: 928 kB
PageTables: 456 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 56384 kB
Committed_AS: 90148 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 1020 kB
VmallocChunk: 0 kB
Percpu: 188 kB
DirectMap4k: 14196 kB
DirectMap2M: 116736 kB
iex(15)> mount
** (CompileError) iex:15: undefined function mount/0 (there is no such import)
iex(15)> cmd("mount")
/dev/root on / type squashfs (ro,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=1024k,nr_inodes=13690,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,relatime,size=11280k)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5640k,mode=755)
/dev/rootdisk0p1 on /boot/grub type vfat (ro,nosuid,nodev,noexec,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/rootdisk0p4 on /root type ext4 (rw,nodev,relatime)
0
iex(16)> df
** (CompileError) iex:16: undefined function df/0 (there is no such import)
iex(16)> cmd("df")
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 23680 23680 0 100% /
devtmpfs 1024 0 1024 0% /dev
tmpfs 11280 4 11276 0% /tmp
tmpfs 5640 4 5636 0% /run
/dev/rootdisk0p1 15477 3 15474 0% /boot/grub
/dev/rootdisk0p4 243631 23 226405 0% /root
0
iex(17)>
以上。