2017年12月3日日曜日

[MCPE] MinetをLinuxで動かしてみる!

たぶん、サーバーはlinux使うことが多いでしょうから、linux(ubuntu)で試してみます。


入れとくソフト
-git
-mono-xbuild
-nuget



1.monoの最新版を入れてください
ubuntu16.04ならば
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list sudo apt-get update
sudo apt-get install mono-devel nuget


2.MiNetをダウンロードします

mkdir /work

cd /work

git clone https://github.com/NiclasOlofsson/MiNET.git minet   #ここで、githubからminetを取り寄せる

cd minet

3.セットアップ

msbuild src/MiNET/MiNET.sln /p:Configuration=Linux #コンパイルします



nuget restore src/MiNET/MiNET.sln #必要なライブラリをダウンロード

4.起動
cd src/MiNET/MiNET.Service/bin/Linux; mono MiNET.Service.exe#これで起動


起動しなかったら、server.confで作成済みのanvilのワールドを選択してください。


Win版との互換性は知りません。

一応動作テストは成功しました。(2017/12/3現在)


参考文献
https://github.com/NiclasOlofsson/MiNET/wiki/Running-MiNET-on-Linux
http://www.mono-project.com/download/#download-lin


nvmeの総書き込み(TBW)を調べる on Linux

nvmeのsmartから寿命を見るのは、Linuxでは多少の苦労を伴うようです。
しかし、2つのコマンドを駆使するとわかるようです。
自分の場合、書き込み量のsmartの結果がエラーで見れません。でも直すのも敷居が高そうなので、別の方法で読んでみます。

http://builds.smartmontools.org/ から適宜ツールをダウンロード

[email protected]:/tmp/usr/local/sbin# nvme smart-log /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning                    : 0
temperature                         : 34 C
available_spare                     : 100%
available_spare_threshold           : 4%
percentage_used                     : 4%
data_units_read                     : 2,591,389
data_units_written                  : 11,044,311
host_read_commands                  : 19,218,485
host_write_commands                 : 112,267,107
controller_busy_time                : 11,194
power_cycles                        : 7
power_on_hours                      : 1,074
unsafe_shutdowns                    : 1
media_errors                        : 0
num_err_log_entries                 : 0
Warning Temperature Time            : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1                : 0 C
Temperature Sensor 2                : 0 C
Temperature Sensor 3                : 0 C
Temperature Sensor 4                : 0 C
Temperature Sensor 5                : 0 C
Temperature Sensor 6                : 0 C
Temperature Sensor 7                : 0 C
Temperature Sensor 8                : 0 C


[email protected]:/tmp/usr/local/sbin# ./smartctl -x /dev/nvme0n1
smartctl 6.6 2017-08-08 r4433 [x86_64-linux-4.4.0-93-generic] (daily-20170914)
Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       *******
Serial Number:                      xxxxxxxx
Firmware Version:                   xxxxxxxx
PCI Vendor ID:                      xxxxx
PCI Vendor Subsystem ID:           xxxxx
IEEE OUI Identifier:                xxxxxx
Controller ID:                      0
Number of Namespaces:               1
Namespace 1 Size/Capacity:          256,060,514,304 [256 GB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Fri Sep 15 22:18:20 2017 JST
Firmware Updates (0x14):            2 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL *Other*
Optional NVM Commands (0x0016):     Wr_Unc DS_Mngmt Sav/Sel_Feat
Maximum Data Transfer Size:         32 Pages
Warning  Comp. Temp. Threshold:     85 Celsius
Critical Comp. Temp. Threshold:     88 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     8.25W    5.00W       -    0  0  0  0        0       0
 1 +     8.25W    3.50W       -    1  1  1  1        0       0
 2 +     8.25W    3.00W       -    2  2  2  2        0       0
 3 -   0.0500W       -        -    0  0  0  0    51000   10000
 4 -   0.0055W       -        -    0  0  0  0  1000000  100000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0
 1 -    4096       0         0

=== START OF SMART DATA SECTION ===
Read NVMe SMART/Health Information failed: NVMe Status 0x4002

公式

得られた情報から、赤いとこだけ抜き出します。

data_units_written × Namespace 1 Formatted LBA Size = 総書き込み量 [kb]

data_units_read × Namespace 1 Formatted LBA Size = 総読み込み量 [kb]

これにより、nvmeの書き込み量と総読み込み量が求められます。


参考

https://forums.lime-technology.com/topic/52072-nvme-gui-integration-partition-format-amp-smart-info/

idcf ベンチマークテスト  1022

idcf cloudのs1プランのベンチ。

[email protected]:~# wget -O /dev/null http://speedtest.dallas.linode.com/100MB-dallas.bin
--2016-08-04 20:36:23--  http://speedtest.dallas.linode.com/100MB-dallas.bin
Resolving speedtest.dallas.linode.com (speedtest.dallas.linode.com)... 50.116.25.154, 2600:3c00::4b
Connecting to speedtest.dallas.linode.com (speedtest.dallas.linode.com)|50.116.25.154|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: ‘/dev/null’

100%[======================================>] 104,857,600 7.44MB/s   in 12s

2016-08-04 20:36:36 (8.03 MB/s) - ‘/dev/null’ saved [104857600/104857600]

[email protected]:~# wget -O /dev/null http://speedtest.tokyo.linode.com/100MB-tokyo.bin
--2016-08-04 20:36:51--  http://speedtest.tokyo.linode.com/100MB-tokyo.bin
Resolving speedtest.tokyo.linode.com (speedtest.tokyo.linode.com)... 106.187.96.148, 2400:8900::4b
Connecting to speedtest.tokyo.linode.com (speedtest.tokyo.linode.com)|106.187.96.148|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: ‘/dev/null’

100%[======================================>] 104,857,600  105MB/s   in 0.9s

2016-08-04 20:36:52 (105 MB/s) - ‘/dev/null’ saved [104857600/104857600]

[email protected]:~#

[email protected]:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
stepping        : 0
microcode       : 0x427
cpu MHz         : 2799.999
cache size      : 25600 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 vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm ida arat epb pln pts dtherm fsgsbase smep
bugs            :
bogomips        : 5599.99
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

[email protected]:~#

[email protected]:~# cat /proc/meminfo
MemTotal:        4038468 kB

[email protected]:~# dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 4.53822 s, 237 MB/s




[email protected]:~/UnixBench/results# cat hani*
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: hanio-1.cs1336idcfcloud.internal: GNU/Linux
   OS: GNU/Linux -- 4.2.0-36-generic -- #42~14.04.1-Ubuntu SMP Fri May 13 17:27:22 UTC 2016
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz (5600.0 bogomips)
          x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   20:40:25 up 13 min,  1 user,  load average: 0.14, 0.15, 0.12; runlevel 2

------------------------------------------------------------------------
Benchmark Run: Thu Aug 04 2016 20:40:25 - 21:08:36
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       31163222.6 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     3793.0 MWIPS (10.3 s, 7 samples)
Execl Throughput                               2992.4 lps   (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks       1032265.2 KBps  (30.1 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          302399.7 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       2276904.9 KBps  (30.0 s, 2 samples)
Pipe Throughput                             2056524.5 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 317445.8 lps   (10.0 s, 7 samples)
Process Creation                              11704.8 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   5615.2 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    626.6 lpm   (60.0 s, 2 samples)
System Call Overhead                        3954171.6 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   31163222.6   2670.4
Double-Precision Whetstone                       55.0       3793.0    689.6
Execl Throughput                                 43.0       2992.4    695.9
File Copy 1024 bufsize 2000 maxblocks          3960.0    1032265.2   2606.7
File Copy 256 bufsize 500 maxblocks            1655.0     302399.7   1827.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    2276904.9   3925.7
Pipe Throughput                               12440.0    2056524.5   1653.2
Pipe-based Context Switching                   4000.0     317445.8    793.6
Process Creation                                126.0      11704.8    929.0
Shell Scripts (1 concurrent)                     42.4       5615.2   1324.3
Shell Scripts (8 concurrent)                      6.0        626.6   1044.4
System Call Overhead                          15000.0    3954171.6   2636.1
                                                                   ========
System Benchmarks Index Score                                        1475.5

PQi Air Pen /proc/集

/procの一覧です。

~ # cat /proc/cpuinfo
system type             : Atheros AR9330 (Hornet)
processor               : 0
cpu model               : MIPS 24Kc V7.4
BogoMIPS                : 232.96
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 16
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x0258, 0x0ff8, 0x0c13]
ASEs implemented        : mips16
shadow register sets    : 1
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

~ # ]

~ # cat /proc/meminfo
MemTotal:          29208 kB
MemFree:           19468 kB
Buffers:              60 kB
Cached:             2400 kB
SwapCached:            0 kB
Active:             1912 kB
Inactive:           1564 kB
Active(anon):       1024 kB
Inactive(anon):        0 kB
Active(file):        888 kB
Inactive(file):     1564 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:          1048 kB
Mapped:             1408 kB
Slab:               4392 kB
SReclaimable:        364 kB
SUnreclaim:         4028 kB
PageTables:          160 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:       14604 kB
Committed_AS:       3236 kB
VmallocTotal:    1048404 kB
VmallocUsed:        1404 kB
VmallocChunk:    1045032 kB

~ # cat /proc/diskstats
   1       0 ram0 0 0 0 0 0 0 0 0 0 0 0
  31       0 mtdblock0 0 0 0 0 0 0 0 0 0 0 0
  31       1 mtdblock1 0 0 0 0 0 0 0 0 0 0 0
  31       2 mtdblock2 0 0 0 0 0 0 0 0 0 0 0
  31       3 mtdblock3 4 1 40 4 2 2 32 60 0 64 64
  31       4 mtdblock4 0 0 0 0 0 0 0 0 0 0 0
  31       5 mtdblock5 9964 43621 107170 37112 0 0 0 0 0 37060 37068
  31       6 mtdblock6 0 0 0 0 0 0 0 0 0 0 0
  31       7 mtdblock7 0 0 0 0 0 0 0 0 0 0 0
  31       8 mtdblock8 0 0 0 0 0 0 0 0 0 0 0
   8       0 sda 1345 6 1414 37860 204 209 18823 44660 0 5192 82520
   8       1 sda1 1343 3 1374 37840 204 209 18823 44660 0 5172 82500
~ # cat /proc/mtd      
dev:    size   erasesize  name
mtd0: 00040000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "ART"
mtd3: 00010000 00010000 "NVRAM"
mtd4: 00140000 00010000 "uImage"
mtd5: 00280000 00010000 "rootfs"
mtd6: 00140000 00010000 "uImage2"
mtd7: 00280000 00010000 "rootfs2"
mtd8: 00010000 00010000 "CONF"


~ # cat /proc/modules     
umac 576480 0 - Live 0xc02b6000
ath_dev 207072 1 umac, Live 0xc01c3000 (P)
ath_rate_atheros 20032 1 ath_dev, Live 0xc0174000 (P)
ath_hal 371936 2 umac,ath_dev, Live 0xc010b000 (P)
adf 9904 3 umac,ath_dev,ath_hal, Live 0xc0096000
asf 6816 3 umac,ath_dev,ath_hal, Live 0xc0089000 (P)
athrs_gmac 49616 0 - Live 0xc0072000
usb_storage 38400 1 - Live 0xc003e000
ehci_hcd 32928 0 - Live 0xc001d000

~ # ls /
bin         lib         mnt         sbin        usr
dev         linuxrc     proc        sys         var
etc         lost+found  root        tmp         version

~ # cat version
V0.1.22

~ # ls /lib
ld-uClibc-0.9.30.so   libutil-0.9.30.so     libxt_length.so
ld-uClibc.so.0        libutil.so.0          libxt_limit.so
libc.so.0             libxt_CLASSIFY.so     libxt_mac.so
libcrypt-0.9.30.so    libxt_CONNMARK.so     libxt_mark.so
libcrypt.so.0         libxt_CONNSECMARK.so  libxt_multiport.so
libdl-0.9.30.so       libxt_DSCP.so         libxt_owner.so
libdl.so.0            libxt_MARK.so         libxt_physdev.so
libgcc_s.so           libxt_NFLOG.so        libxt_pkttype.so
libgcc_s.so.1         libxt_NFQUEUE.so      libxt_quota.so
libipt_DNAT.so        libxt_NOTRACK.so      libxt_rateest.so
libipt_MASQUERADE.so  libxt_RATEEST.so      libxt_sctp.so
libm-0.9.30.so        libxt_SECMARK.so      libxt_standard.so
libm.so.0             libxt_TCPMSS.so       libxt_state.so
libnsl-0.9.30.so      libxt_TCPOPTSTRIP.so  libxt_statistic.so
libnsl.so.0           libxt_TOS.so          libxt_string.so
libntfs-3g.so         libxt_TRACE.so        libxt_tcp.so
libntfs-3g.so.52      libxt_comment.so      libxt_tcpmss.so
libntfs-3g.so.52.0.0  libxt_connbytes.so    libxt_time.so
libnvram.so           libxt_connlimit.so    libxt_tos.so
libpthread-0.9.30.so  libxt_connmark.so     libxt_u32.so
libpthread.so.0       libxt_conntrack.so    libxt_udp.so
libresolv-0.9.30.so   libxt_dccp.so         libxtables.so
libresolv.so.0        libxt_dscp.so         libxtables.so.0
librt-0.9.30.so       libxt_esp.so          libxtables.so.0.0.0
librt.so.0            libxt_hashlimit.so    modules
libsutil.so           libxt_helper.so
libuClibc-0.9.30.so   libxt_iprange.so
~ # ls /lib/modules
2.6.31
~ # ls /lib/modules/2.6.31
net  usb
~ # ls /lib/modules/2.6.31/net
adf.ko               ath_hal.ko           led0.ko
asf.ko               ath_rate_atheros.ko  umac.ko
ath_dev.ko           athrs_gmac.ko
~ # ls /lib/modules/2.6.31/usb
ehci-hcd.ko     usb-storage.ko
~ # 

~ # ls /bin
ash           dmesg         kill          mv            su
backup        echo          ln            ntfs-3g       sync
busybox       egrep         login         ping          tar
cat           ethdebug      ls            ps            touch
cfg           ethreg        md            pwd           true
chgrp         factoryreset  mkdir         rm            umount
chmod         false         mknod         rmdir         uname
cp            fgrep         mktemp        sed           vi
date          getopt        mm            sh
dd            grep          more          shttpd
df            iproute       mount         sleep


~ # mount -l
mount: invalid option -- l
/dev/mtdblock5 on / type squashfs (ro,relatime)
/proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
none on /tmp type ramfs (rw,relatime)
/sys on /sys type sysfs (rw,relatime)
udev on /dev type ramfs (rw,relatime)
/dev/pts on /dev/pts type devpts (rw,relatime,mode=600)
/dev/sda1 on /tmp/www/ftp/sda1 type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,errors=remount-ro)

/dev/sda1(mmcblk0でない)がsdカードで、/tmp/www/ftp/sda1がsdカード共有dirらしい

~ # touch a
touch: a: Read-only file system

/sbin # ls
80211stats      init            reg             version
backupPS        insmod          rmmod           vsftpd
brctl           iptables        route           wdog
dnsmasq         iwconfig        sparkling       wlanconfig
dumpregs        iwlist          udevcontrol     wpa_cli
fdisk           iwpriv          udevd           wpa_supplicant
flash_erase     lsmod           udevsettle      wps_pbc
fwUpgrade       modprobe        udevstart       wpscli_ap
getty           mountUSB        udevtrigger     wpscli_sta
hostapd         nvram           udhcpc
hostapd_cli     rc              umountUSB
ifconfig        reboot          vconfig

/sbin # ls /etc
ath              host.conf        rc.d             udhcpd.conf
backup.script    hosts            resolv.conf      udhcpd_br0.conf
chkcfg           inittab          securetty        vsftpd.conf
connect.sh       issue            services         wep_def.conf
connect1.sh      nsswitch.conf    shadow           wpa.conf
dnsmasq.conf     nvram.deft       udev             wpa_def.conf
fstab            nvram.update     udhcpc.script
group            passwd           udhcpc2.script

/sbin # ls /usr/bin
[        dirname  expr     id       passwd   telnet   tty
arping   du       find     killall  strings  test     wc
cut      env      hexdump  md5sum   tail     tftp     xargs
/sbin # ls /usr/sbin
httpd    telnetd  udhcpd   wdog
/sbin # ls /usr/www 
cgi-bin             frame1.html         page.html
cmd.html            images              page2.html
configuration.html  index.html          style.css
empty.html          login.html          styleSheet.css
/sbin # ls /usr/lib
libcrypt-0.9.30.so  libcrypt.so.0
/sbin # 

/sbin # tar
BusyBox v1.01 (2013.01.03-08:27+0000) multi-call binary

Usage: tar -[czxtvO] [-f TARFILE] [-C DIR] [FILE(s)] ...

Create, extract, or list files from a tar file.

Options:
        c               create
        x               extract
        t               list

Archive format selection:
        z               Filter the archive through gzip

File selection:
        f               name of TARFILE or "-" for stdin
        O               extract to stdout
        C               change to directory DIR before operation
        v               verbosely list files processed

/sbin #


/tmp # ls
dnsmasq.pid     mtd_nvram       secbr0          wpa.conf
hostapd         rc.pid          staState        wpa_supplicant
mnt             rc_state        udhcpd.pid      www
/tmp # cat wpa.conf
ctrl_interface=/tmp/wpa_supplicant
update_config=1
ap_scan=1

 network={
       scan_ssid=1
       priority=1

ssid="F660T-hVCv-G"
key_mgmt=WPA-PSK
psk="kXsWEsXu"
}
/tmp # cat staState
Connected
/tmp # cat secbr0  
interface=ath0
bridge=br0
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
dtim_period=2
max_num_sta=255
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wme_enabled=0
ieee8021x=0
eapol_key_index_workaround=0
eap_server=1

/tmp # cat rc_stat
cat: rc_stat: No such file or directory
/tmp # cat rc_state
0

/tmp # 

~ # cat /proc/version
Linux version 2.6.31.AirPen_V0.1.22-g5eca71a ([email protected]) (gcc version 4.3.3 (GCC) ) #319 Thu Jan 3 16:27:02 CST 2013

~ #


mipsコンパイル資料断片

mipsでpqi pen airの実験をした時の資料です。
下書きのままにしとくのもあれだったので。。。

ncurses-devel

http://www.arch.cs.titech.ac.jp/mcore/buildroot.html

mips32bit big

make -j core数

apt install bc g++
https://www.debian.org/ports/mips/index.ja.html

http://kaworu.jpn.org/cpp/g++%E3%82%92Ubuntu%E3%81%B8%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B


output/host/usr


ftp

telnet


helloworld

http://qiita.com/funa-tk/items/c4a239423eea018adea1


/////python build....
autoconf


./configure --prefix=/work/emb/ruby-trunk/outbin


///libxml2

wget ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz
適宜解凍
cd libxml2
mkdir outbin
autoconf
./configure CC=mips-linux-gcc  CXX=mips-linux-g++  --prefix=/work/emb/libxml2/outbin CFLAGS="-g -O2 -Wall -pedantic -static -march=24kc" ARCH=mips AR=mips-linux-ar LD=mips-linux-ld RANLIB=mips-linux-ranlib --without-python --without-iconv --without-zlib
make
make install

うまくいった!?
//////

///php5.5
wget http://in1.php.net/get/php-5.5.4.tar.gz/from/this/mirror
tar xfzv php-5.5.4.tar.gz
cd php-5.5.4/
./configure CC=mips-linux-gcc CXX=mips-linux-g++ AR=mips-linux-ar LD=mips-linux-ld RANLIB=mips-linux-ranlib --host=mips --target=mips -prefix=/work/emb/phpbin --without-sqlite3  --without-pdo-sqlite --without-pear --enable-simplexml --disable-mbregex  --enable-libxml --without-zlib  --with-libxml-dir=/work/emb/libxml2/outbin/ --disable-all  ARCH=mips
make
make install

/tmp/www/ftp/sda1/libxml2/outbin/bin # echo "<?php echo "a";?>">a.php
/tmp/www/ftp/sda1/libxml2/outbin/bin # ./mips-php a.php

Segmentation fault
//////

///python///
 wget https://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
cd Python-2.7.2
mkdir outbin
./configure CC=mips-linux-gcc  CXX=mips-linux-g++  --prefix=/work/emb/Python-2.7.2/outbin CFLAGS="-g -O2 -Wall -pedantic -static -march=24kc" ARCH=mips AR=mips-linux-ar LD=mips-linux-ld  RANLIB=mips-linux-ranlib --host=mips-linux

Include/pyport.h:243:13: error: #error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"

直し方 http://www.cnx-software.com/2011/02/04/cross-compiling-python-for-mips-and-arm-platforms/

Include/unicodeobject.h:575:20: error: unknown type name \u2018wchar_t\u2019
     register const wchar_t *w,  /* wchar_t buffer */
                    ^
Include/unicodeobject.h:593:14: error: unknown type name \u2018wchar_t\u2019
     register wchar_t *w,        /* wchar_t buffer */

wchar_t is defined in \clang\2.9\stddef.h and in \ansi\ctype.h. You will end up using the ctype.h definition if you include windows.h in your application. Have you tried including windows.h?

https://forums.ni.com/t5/LabWindows-CVI/unknown-type-name-wchar-t/td-p/2978413

1
2
export CFLAGS="-g3 -fsanitize=undefined -DPY_FORMAT_LONG_LONG=1"
export CXXFLAGS="-g3 -fsanitize=undefined -fno-sanitize=vptr -DPY_FORMAT_LONG_LONG=1"



////

http://samarthparikh.blogspot.jp/2013/09/cross-compile-lighttpd-php-for-arm.html
http://xmlsoft.org/downloads.html
https://forum.nginx.org/read.php?3,64091,87800
http://stackoverflow.com/questions/29971622/cross-compiling-driver-for-mips
http://qiita.com/dodo5522/items/32cc28e4f10ad7ed4b8d




2017年10月4日水曜日

PocketMineの旧プラグインAPI対応方法

pmmp公式のプラグインAPIが変更となりました。
が、多くのプラグインは新APIに対応していません。
あえて新APIにプラグインを書き直す理由もわからないので、スクリプトを組みました。

Error: Declaration of DevTools\DevTools::onCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, $label, array $args) must be compatible with pocketmine\command\CommandExecutor::onCommand(pocketmine\command\CommandSender $sender, pocketmine\command\Command $command, string $label, array $args): bool

こんなエラーがAPI不一致で発生します。

https://github.com/haniokasai/PocketMine-OldAPI-Replacer

型をコマンドで置き換える単純なものです。


http://jenkins.haniokasai.com/view/PocketMineS/
ここのsrcはすべて旧APIのものです。置き換えるのが面倒ならば、お使いください。


Ubuntuでのネットワークアダプタの探し方。

/etc/network/interfacesに
auto eth1
iface eth1 inet static
とか書きますけど、なんでeth1断定できるのかわけわかんない。
どんな環境でも絶対eth0とか1なのかよ。。。

そんなことはありません。てなわけで、ネットワークアダプタの探し方を紹介します。
ls /sys/class/net
すると、アダプタ一覧が表示されました。
[email protected]:~# ls /sys/class/net
enp0s3  enp0s8  enp0s9  lo
[email protected]:~# vi /etc/network/interfaces
^[[[email protected]:~# ifup enp0s3
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp0s3/0ああああ
Sending on   LPF/enp0s3/0ああああ
Sending on   Socket/fallback
DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3 (xid=0xebc6721b)

DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 6 (xid=0xebc6721b)
DHCPREQUEST of ああ on enp0s3 to 255.255.255.255 port 67 (xid=0x1b72c6eb)
DHCPOFFER of ああ from あああ
DHCPACK of ああ from あああ
bound to ああ -- renewal in 40279 seconds.
[email protected]:~# 
[email protected]:~# ping haniokasai.com
PING haniokasai.com (104.27.142.118) 56(84) bytes of data.
64 bytes from 104.27.142.118: icmp_seq=1 ttl=54 time=57.0 ms
64 bytes from 104.27.142.118: icmp_seq=2 ttl=54 time=55.6 ms
^C
--- haniokasai.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 55.672/56.344/57.017/0.713 ms
[email protected]:~# 

ようやくネットが使えるようになりました。。。
うまく動かなくなったvirtualboxで。。。

参考文献
https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in



[MCPE] MinetをLinuxで動かしてみる!

たぶん、サーバーはlinux使うことが多いでしょうから、linux(ubuntu)で試してみます。 入れとくソフト -git -mono-xbuild -nuget 1.monoの最新版を入れてください ubuntu16.04ならば sudo apt-...