wslでnerves その5

# 概要
wsl(wsl2じゃない)でnervesやってみる。
qemu(x86_64エミュレータ、ラズパイじゃない)でやってみた。
shell server、実装してみた。
c#から、叩いてみた。
調査してみた。

# 実行結果

```
>tcp0

>
ls /
var
usr
tmp
sys
srv
share
sbin
run
root
proc
opt
mnt
media
lib64
lib
etc
dev
data
boot
bin


>tcp0

>
ls /boot
grub
bzImage


>tcp0

>
ls /boot/grub
boot


>tcp0

>
ls /etc
sysctl.conf
ssl
shells
shadow
resolv.conf
protocols
passwd
os-release
odbcinst.ini
odbc.ini
network
mke2fs.conf
libnl
iex.exs
hosts
grub.d
group
fw_env.config
erlinit.config
erl_inetrc
boardid.config


>tcp0

>
ls /boot/bzImage
/boot/bzImage


>tcp0

>
ls /bin
umount
sleep
sh
rmdir
rm
pwd
ps
mv
mount
mknod
mkdir
mk_cmds
lsattr
ls
kill
grub-syslinux2cfg
grub-script-check
grub-render-label
grub-mkstandalone
grub-mkrescue
grub-mkrelpath
grub-mkpasswd-pbkdf2
grub-mknetdir
grub-mklayout
grub-mkimage
grub-menulst2cfg
grub-kbdcomp
grub-glue-efi
grub-fstest
grub-file
grub-editenv
grep
dmesg
df
dd
date
cp
compile_et
chattr
cat
busybox
ash


>tcp0

>
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 [m

>tcp0

>
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


>tcp0

>
ls /sbin
uevent
udhcpc
tune2fs
sysctl
rmmod
reboot
poweroff
modprobe
modinfo
mklost+found
mkfs.ext4
mkfs.ext3
mkfs.ext2
mke2fs
lsmod
logsave
iptunnel
iprule
iproute
ipneigh
iplink
ipaddr
ip
init
ifconfig
halt
grub-sparc64-setup
grub-set-default
grub-reboot
grub-probe
grub-ofpathname
grub-mkconfig
grub-macbless
grub-install
grub-bios-setup
fsck.ext4
fsck.ext3
fsck.ext2
filefrag
e4crypt
e2undo
e2mmpstatus
e2label
e2fsck
e2freefrag
dumpe2fs
badblocks


>tcp0

>
ls /proc
124
92
91
90
89
77
71
69
64
61
46
41
40
39
38
37
36
35
34
33
32
23
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
4
3
2
1
thread-self
self
pagetypeinfo
vmallocinfo
filesystems
execdomains
timer_list
partitions
kpageflags
kpagecount
interrupts
diskstats
config.gz
buddyinfo
zoneinfo
softirqs
slabinfo
kallsyms
consoles
version
sysvipc
modules
meminfo
loadavg
ioports
devices
cpuinfo
cmdline
vmstat
uptime
mounts
driver
crypto
asound
swaps
locks
iomem
stat
scsi
mtrr
misc
kmsg
acpi
tty
sys
net
irq
dma
bus
fs
fb


>tcp0

>
ls /proc/cpuinfo
/proc/cpuinfo


>tcp0

>
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.668
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.33
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:


>
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        21    226407   0% /root


>tcp0

>
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)


>tcp0

>
date
Fri Jan  6 22:21:45 UTC 2023




>tcp0

>
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


>tcp0

>
ls /root
nerves_ssh
lost+found


>tcp0

>
ls /data
nerves_ssh
lost+found


```


以上。