2017年8月30日水曜日

★★★raspbian で ルートを USBハードディスクにする


すべてハードディスクで運用
です、 youtubeにも載ってますね
これは 前のraspbianではできたのですが、
stretchでは 何故か失敗。


従って 以下のでは上の図の如く

rootを USBハードディスクにおいた。
micro SD はセルモーターのように起動に必要なだけとなった。


このUSBドライブは 容量が320Gあるので raspberry pi 3は 立派なサーバーとなった。


たくさん書かれてますが、 rsync を利用した方法でやってみました。
https://www.raspberrypi.org/documentati ... des/msd.md
ここが出発点ですが ちょっと不親切です。


1) raspbian を普通に マイクロsd で立ち上げます。

2) rewrite /boot/config.txt
dtoverlay=hifiberry-dacplus
dtparam=audio=on
program_usb_boot_mode=1

3) 再び raspbian を普通に マイクロsd でたちあげ
そして次を確かめます
vcgencmd otp_dump | grep 17:


# > 17:3020000a
こうなってなうといけません
( たしかにこうなってたが stretch では何かがかわったのか
 USB HDDのみの運用は 結果的にはだめで
スターターとしての マイクロSDカードが要った ) 


4)この後  raspbian をシャットダウンし マイクロsdを抜き取ります。


-------------------------

5) 以下  archlinuxの PC に
マイクロSDカードと USBハードディスクをつけます

まず raspbian のマイクロSD(/dev/sdc)のブートローダ部分を
HDD(/dev/sdd)に コピーするため

dd if=/dev/sdc of=/dev/sdd bs=512 count=16000

します


6)いま
マイクロsd は 以下です
fdisk -l /dev/sdc
Disk /dev/sdc: 15 GiB, 16088301568 bytes, 31422464 sectors
Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdc1           8192    93596    85405 41.7M  c W95 FAT32 (LBA)
/dev/sdc2          94208 27277311 27183104   13G 83 Linux


さて USB ハードディスクを を次のようにします。
 1            8192         1056767   512.0 MiB   0700  Microsoft basic data
 2         5252000       125542366   57.4 GiB    8300  Linux filesystem
 3         1056800         5251071   2.0 GiB     8200  Linux swap




mkfs.vfat   /dev/sdd1
mkfs.ext4  /dev/sdd2
mkswap     /dev/sdd3




6)
mount /dev/sdc1 /mc1
mount /dev/sdc2 /mc2

mount /dev/sdd1 /md1
mount /dev/sdd2 /md2


rsync -avHx /mc1/ /md1/
rsync -avHx /mc2/ /md2/


別法                                                                            
(cd /mc2;tar cvpf - .  )       |      (cd /md2 ; tar xpf - )




7)ファイルを3つ書き換えます
cp /md1/cmdline.txt /md1/cmdline.txt-ori
/md1/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles



/md2/etc/fstab
proc /proc proc defaults 0 0
/dev/sda1 /boot vfat defaults 0 2
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda2 none swap defaults 0 0



/md2/etc/rc.local
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
sleep 30
service dphys-swapfile stop
exit 0



8) umount /md1 /md2 /mc1 /mc2



9)こうしておいてから USBハードディスクだけをRpi3にくっつけて電源をいれると
たちあがります。 




PS)
なお 元のSDのみの運用に戻す時は
cp /md1/cmdline.txt-ori  /md1/cmdline.txt
です



以下は現在の状態です

 /etc/rc.local 

_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
sleep 30
service dphys-swapfile stop
/home/pi/sshd+swapon.bat
exit 0


/home/pi/sshd+swapon.bat 
swapon /dev/sda3
/etc/init.d/ssh restart






/etc/fstab 
proc            /proc           proc    defaults          0       0
/dev/sda1 /boot vfat defaults 0 2
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda2 none swap defaults 0 0




/boot/config.txt
dtoverlay=hifiberry-dacplus
dtparam=audio=on


 /boot/cmdline.txt 
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles



/etc/rc.local
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
sleep 30
service dphys-swapfile stop
exit 0



df
ファイルシス   1K-ブロック    使用    使用可 使用% マウント位置
/dev/root        295746776 5530632 275123332    2% /
devtmpfs            470116       0    470116    0% /dev
tmpfs               474724       0    474724    0% /dev/shm
tmpfs               474724   12372    462352    3% /run
tmpfs                 5120       4      5116    1% /run/lock
tmpfs               474724       0    474724    0% /sys/fs/cgroup
/dev/sda1           523992   23064    500928    5% /boot
tmpfs                94944       0     94944    0% /run/user/1000
/dev/mmcblk0p1       42131   22141     19990   53% /media/pi/boot



free
              total        used        free      shared  buff/cache   available
Mem:         949452       99728      518196       12668      331528      772580
Swap:      10485592           0    10485592






ifconfig 
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:ce:cf:d8  txqueuelen 1000  (イーサネット)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (ローカルループバック)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.122.8  netmask 255.255.255.0  broadcast 192.168.122.255
        inet6 fe80::8836:20cd:a2f0:85d5  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:9b:9a:8d  txqueuelen 1000  (イーサネット)
        RX packets 525  bytes 56580 (55.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 267  bytes 39811 (38.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



 iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  



# dmesg 
root@raspberrypi:/home/pi# ./comment-out.bat d0
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.34-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1110 SMP Mon Apr 16 15:18:51 BST 2018
[    0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 8 MiB at 0x3ac00000
[    0.000000] On node 0 totalpages: 242688
[    0.000000] free_area_init_node: node 0, pgdat 80c84e40, node_mem_map ba3a1000
[    0.000000]   Normal zone: 2133 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 242688 pages, LIFO batch:31
[    0.000000] random: fast init done
[    0.000000] percpu: Embedded 17 pages/cpu @ba34a000 s38720 r8192 d22720 u69632
[    0.000000] pcpu-alloc: s38720 r8192 d22720 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 240555
[    0.000000] Kernel command line: 8250.nr_uarts=0 bcm2708_fb.fbwidth=1184 bcm2708_fb.fbheight=624 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 940236K/970752K available (7168K kernel code, 575K rwdata, 2072K rodata, 1024K init, 706K bss, 22324K reserved, 8192K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xbb800000 - 0xff800000   (1088 MB)
                   lowmem  : 0x80000000 - 0xbb400000   ( 948 MB)
                   modules : 0x7f000000 - 0x80000000   (  16 MB)
                     .text : 0x80008000 - 0x80800000   (8160 kB)
                     .init : 0x80b00000 - 0x80c00000   (1024 kB)
                     .data : 0x80c00000 - 0x80c8fd4c   ( 576 kB)
                      .bss : 0x80c96f4c - 0x80d478b4   ( 707 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 25231 entries in 74 pages
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000019] Switching to timer-based delay loop, resolution 52ns
[    0.000267] Console: colour dummy device 80x30
[    0.000285] console [tty1] enabled
[    0.000310] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000)
[    0.000325] pid_max: default: 32768 minimum: 301
[    0.000642] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000657] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.001590] Disabling memory control group subsystem
[    0.001670] CPU: Testing write buffer coherency: ok
[    0.002066] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002444] Setting up static identity map for 0x100000 - 0x10003c
[    0.002561] Hierarchical SRCU implementation.
[    0.003190] smp: Bringing up secondary CPUs ...
[    0.003876] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.004627] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.005358] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.005463] smp: Brought up 1 node, 4 CPUs
[    0.005473] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.005479] CPU: All CPU(s) started in HYP mode.
[    0.005483] CPU: Virtualization extensions available.
[    0.006336] devtmpfs: initialized
[    0.017081] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4
[    0.017300] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.017319] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.017876] pinctrl core: initialized pinctrl subsystem
[    0.018609] NET: Registered protocol family 16
[    0.021329] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.026132] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.026139] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.026349] Serial: AMBA PL011 UART driver
[    0.027970] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.028429] uart-pl011 3f201000.serial: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[    0.059975] bcm2835-dma 3f007000.dma: DMA legacy API manager at bb813000, dmachans=0x1
[    0.061482] SCSI subsystem initialized
[    0.061704] usbcore: registered new interface driver usbfs
[    0.061756] usbcore: registered new interface driver hub
[    0.061841] usbcore: registered new device driver usb
[    0.070087] raspberrypi-firmware soc:firmware: Attached to firmware from 2018-04-16 18:16
[    0.071503] clocksource: Switched to clocksource arch_sys_counter
[    0.148894] VFS: Disk quotas dquot_6.6.0
[    0.148979] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.149164] FS-Cache: Loaded
[    0.149362] CacheFiles: Loaded
[    0.158172] NET: Registered protocol family 2
[    0.158893] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.159003] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.159189] TCP: Hash tables configured (established 8192 bind 8192)
[    0.159319] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.159363] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.159591] NET: Registered protocol family 1
[    0.160034] RPC: Registered named UNIX socket transport module.
[    0.160040] RPC: Registered udp transport module.
[    0.160045] RPC: Registered tcp transport module.
[    0.160050] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.161675] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available
[    0.164423] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[    0.172329] FS-Cache: Netfs 'nfs' registered for caching
[    0.172914] NFS: Registering the id_resolver key type
[    0.172949] Key type id_resolver registered
[    0.172955] Key type id_legacy registered
[    0.172970] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.174831] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.174952] io scheduler noop registered
[    0.174959] io scheduler deadline registered (default)
[    0.175235] io scheduler cfq registered
[    0.175242] io scheduler mq-deadline registered
[    0.175248] io scheduler kyber registered
[    0.177952] BCM2708FB: allocated DMA memory fad10000
[    0.177979] BCM2708FB: allocated DMA channel 0 @ bb813000
[    0.199092] Console: switching to colour frame buffer device 148x39
[    0.212329] bcm2835-rng 3f104000.rng: hwrng registered
[    0.212470] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    0.212941] vc-sm: Videocore shared memory driver
[    0.213215] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    0.222799] brd: module loaded
[    0.231443] loop: module loaded
[    0.231457] Loading iSCSI transport class v2.0-870.
[    0.232140] libphy: Fixed MDIO Bus: probed
[    0.232232] usbcore: registered new interface driver lan78xx
[    0.232286] usbcore: registered new interface driver smsc95xx
[    0.232303] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.460419] Core Release: 2.80a
[    0.460428] Setting default values for core params
[    0.460461] Finished setting default values for core params
[    0.660702] Using Buffer DMA mode
[    0.660708] Periodic Transfer Interrupt Enhancement - disabled
[    0.660713] Multiprocessor Interrupt Enhancement - disabled
[    0.660721] OTG VER PARAM: 0, OTG VER FLAG: 0
[    0.660731] Dedicated Tx FIFOs mode
[    0.661103] WARN::dwc_otg_hcd_init:1046: FIQ DMA bounce buffers: virt = 0xbad04000 dma = 0xfad04000 len=9024
[    0.661128] FIQ FSM acceleration enabled for :
               Non-periodic Split Transactions
               Periodic Split Transactions
               High-Speed Isochronous Endpoints
               Interrupt/Control Split Transaction hack enabled
[    0.661135] dwc_otg: Microframe scheduler enabled
[    0.661190] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x805e6a40
[    0.661201] WARN::hcd_init_fiq:460: FIQ ASM at 0x805e6da8 length 36
[    0.661213] WARN::hcd_init_fiq:486: MPHI regs_base at 0xbb87e000
[    0.661269] dwc_otg 3f980000.usb: DWC OTG Controller
[    0.661302] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    0.661333] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[    0.661380] Init: Port Power? op_state=1
[    0.661385] Init: Power Port (0)
[    0.661610] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.661621] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.661630] usb usb1: Product: DWC OTG Controller
[    0.661638] usb usb1: Manufacturer: Linux 4.14.34-v7+ dwc_otg_hcd
[    0.661646] usb usb1: SerialNumber: 3f980000.usb
[    0.662241] hub 1-0:1.0: USB hub found
[    0.662280] hub 1-0:1.0: 1 port detected
[    0.662820] dwc_otg: FIQ enabled
[    0.662825] dwc_otg: NAK holdoff enabled
[    0.662830] dwc_otg: FIQ split-transaction FSM enabled
[    0.662839] Module dwc_common_port init
[    0.663068] usbcore: registered new interface driver usb-storage
[    0.663230] mousedev: PS/2 mouse device common for all mice
[    0.663300] IR NEC protocol handler initialized
[    0.663305] IR RC5(x/sz) protocol handler initialized
[    0.663310] IR RC6 protocol handler initialized
[    0.663315] IR JVC protocol handler initialized
[    0.663321] IR Sony protocol handler initialized
[    0.663326] IR SANYO protocol handler initialized
[    0.663331] IR Sharp protocol handler initialized
[    0.663336] IR MCE Keyboard/mouse protocol handler initialized
[    0.663341] IR XMP protocol handler initialized
[    0.664022] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[    0.664288] bcm2835-cpufreq: min=600000 max=1200000
[    0.664649] sdhci: Secure Digital Host Controller Interface driver
[    0.664653] sdhci: Copyright(c) Pierre Ossman
[    0.665002] mmc-bcm2835 3f300000.mmc: could not get clk, deferring probe
[    0.665325] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    0.665423] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.666817] ledtrig-cpu: registered to indicate activity on CPUs
[    0.666989] hidraw: raw HID events driver (C) Jiri Kosina
[    0.667101] usbcore: registered new interface driver usbhid
[    0.667105] usbhid: USB HID core driver
[    0.667814] vchiq: vchiq_init_state: slot_zero = bad80000, is_master = 0
[    0.669180] [vc_sm_connected_init]: start
[    0.678041] [vc_sm_connected_init]: end - returning 0
[    0.678611] Initializing XFRM netlink socket
[    0.678634] NET: Registered protocol family 17
[    0.678723] Key type dns_resolver registered
[    0.679255] Registering SWP/SWPB emulation handler
[    0.679828] registered taskstats version 1
[    0.685593] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    0.685666] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    0.687360] mmc-bcm2835 3f300000.mmc: mmc_debug:0 mmc_debug2:0
[    0.687369] mmc-bcm2835 3f300000.mmc: DMA channel allocated
[    0.742124] sdhost: log_buf @ bad07000 (fad07000)
[    0.777908] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    0.779479] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.781049] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    0.783840] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    0.821525] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    0.822544] of_cfs_init
[    0.822680] of_cfs_init: OK
[    0.823207] Waiting for root device /dev/sda2...
[    0.881718] Indeed it is in host mode hprt0 = 00021501
[    0.949309] mmc0: host does not support reading read-only switch, assuming write-enable
[    0.952145] mmc0: new high speed SDHC card at address 0002
[    0.952674] mmcblk0: mmc0:0002 N/A   7.50 GiB
[    0.954439]  mmcblk0: p1 p2
[    0.963054] mmc1: new high speed SDIO card at address 0001
[    1.091545] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.091660] Indeed it is in host mode hprt0 = 00001101
[    1.331765] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.331777] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.332308] hub 1-1:1.0: USB hub found
[    1.332384] hub 1-1:1.0: 5 ports detected
[    1.651530] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.781737] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.781748] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.784246] smsc95xx v1.0.6
[    1.874508] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:ce:cf:d8
[    1.971532] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[    2.101870] usb 1-1.3: New USB device found, idVendor=1a40, idProduct=0101
[    2.101881] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.101889] usb 1-1.3: Product: USB 2.0 Hub
[    2.102340] hub 1-1.3:1.0: USB hub found
[    2.102428] hub 1-1.3:1.0: 4 ports detected
[    2.201531] usb 1-1.4: new low-speed USB device number 5 using dwc_otg
[    2.336528] usb 1-1.4: New USB device found, idVendor=0461, idProduct=4e66
[    2.336539] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.336548] usb 1-1.4: Product: HP USB Optical Mouse
[    2.336556] usb 1-1.4: Manufacturer: PixArt
[    2.341392] input: PixArt HP USB Optical Mouse as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:0461:4E66.0001/input/input0
[    2.341723] hid-generic 0003:0461:4E66.0001: input,hidraw0: USB HID v1.11 Mouse [PixArt HP USB Optical Mouse] on usb-3f980000.usb-1.4/input0
[    2.441532] usb 1-1.5: new low-speed USB device number 6 using dwc_otg
[    2.743405] usb 1-1.5: New USB device found, idVendor=17ef, idProduct=602d
[    2.743416] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.743424] usb 1-1.5: Product: Lenovo Black Silk USB Keyboard
[    2.743432] usb 1-1.5: Manufacturer: Lenovo
[    2.811427] input: Lenovo Lenovo Black Silk USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/0003:17EF:602D.0002/input/input1
[    2.871993] hid-generic 0003:17EF:602D.0002: input,hidraw1: USB HID v1.11 Keyboard [Lenovo Lenovo Black Silk USB Keyboard] on usb-3f980000.usb-1.5/input0
[    3.010240] input: Lenovo Lenovo Black Silk USB Keyboard as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1/0003:17EF:602D.0003/input/input2
[    3.071679] hid-generic 0003:17EF:602D.0003: input,hidraw2: USB HID v1.11 Device [Lenovo Lenovo Black Silk USB Keyboard] on usb-3f980000.usb-1.5/input1
[   16.066037] random: crng init done
[   16.131538] usb 1-1.3.4: new high-speed USB device number 7 using dwc_otg
[   16.322842] usb 1-1.3.4: New USB device found, idVendor=1058, idProduct=0a10
[   16.322854] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[   16.322863] usb 1-1.3.4: Product: USB to SATA bridge
[   16.322871] usb 1-1.3.4: Manufacturer: JMicron
[   16.322880] usb 1-1.3.4: SerialNumber: 1234567890123
[   16.323813] usb-storage 1-1.3.4:1.0: USB Mass Storage device detected
[   16.324167] scsi host0: usb-storage 1-1.3.4:1.0
[   17.352197] scsi 0:0:0:0: Direct-Access     WDC WD32 00AAKS-00B3A0    9122 PQ: 0 ANSI: 6
[   17.353496] sd 0:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB)
[   17.353927] sd 0:0:0:0: [sda] Write Protect is off
[   17.353939] sd 0:0:0:0: [sda] Mode Sense: 47 00 10 08
[   17.354366] sd 0:0:0:0: [sda] No Caching mode page found
[   17.354538] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   17.364547]  sda: sda1 sda2 sda3
[   17.366854] sd 0:0:0:0: [sda] Attached SCSI disk
[   17.533419] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[   17.533483] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[   17.588323] devtmpfs: mounted
[   17.591366] Freeing unused kernel memory: 1024K
[   18.320199] systemd[1]: System time before build time, advancing clock.
[   18.616909] NET: Registered protocol family 10
[   18.618227] Segment Routing with IPv6
[   18.638749] ip_tables: (C) 2000-2006 Netfilter Core Team
[   18.731289] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[   18.731916] systemd[1]: Detected architecture arm.
[   18.738731] systemd[1]: Set hostname to <raspberrypi>.
[   19.922840] systemd[1]: Listening on udev Control Socket.
[   19.923429] systemd[1]: Listening on Journal Socket.
[   19.923774] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[   19.924596] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[   19.924797] systemd[1]: Listening on Syslog Socket.
[   19.925042] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[   19.925229] systemd[1]: Listening on fsck to fsckd communication Socket.
[   20.689540] i2c /dev entries driver
[   21.146991] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CPU DAI (null) not registered - will retry
[   38.019083] EXT4-fs (sda2): re-mounted. Opts: (null)
[   38.185471] systemd-journald[99]: Received request to flush runtime journal from PID 1
[   38.478633] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CPU DAI (null) not registered - will retry
[   38.487694] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CPU DAI (null) not registered - will retry
[   38.595373] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CPU DAI (null) not registered - will retry
[   38.671385] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CODEC DAI pcm512x-hifi not registered - will retry
[   38.716388] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CODEC DAI pcm512x-hifi not registered - will retry
[   38.726895] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[   38.729700] bcm2835_alsa bcm2835_alsa: card created with 8 channels
[   38.729980] snd-rpi-hifiberry-dacplus soc:sound: ASoC: CODEC DAI pcm512x-hifi not registered - will retry
[   39.339606] snd-rpi-hifiberry-dacplus soc:sound: pcm512x-hifi <-> 3f203000.i2s mapping ok
[   39.473959] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   39.479398] brcmfmac: brcmf_fw_map_chip_to_name: using brcm/brcmfmac43430-sdio.bin for chip 0x00a9a6(43430) rev 0x000001
[   39.479660] usbcore: registered new interface driver brcmfmac
[   39.764618] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   39.788100] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
[   39.788903] brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 Creation: 2017-10-23 03:47:14 
[   42.012733] uart-pl011 3f201000.serial: no DMA platform data
[   43.779788] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   43.779816] brcmfmac: power management disabled
[   44.283747] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   44.284159] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   44.694401] Adding 102396k swap on /var/swap.  Priority:-2 extents:2 across:126972k FS
[   44.913786] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   46.569457] Bluetooth: Core ver 2.22
[   46.569531] NET: Registered protocol family 31
[   46.569537] Bluetooth: HCI device and connection manager initialized
[   46.569558] Bluetooth: HCI socket layer initialized
[   46.569570] Bluetooth: L2CAP socket layer initialized
[   46.569603] Bluetooth: SCO socket layer initialized
[   46.746448] Bluetooth: HCI UART driver ver 2.3
[   46.746461] Bluetooth: HCI UART protocol H4 registered
[   46.746467] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   46.746707] Bluetooth: HCI UART protocol Broadcom registered
[   47.151737] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   47.151748] Bluetooth: BNEP filters: protocol multicast
[   47.151768] Bluetooth: BNEP socket layer initialized
[   47.299430] Bluetooth: RFCOMM TTY layer initialized
[   47.299478] Bluetooth: RFCOMM socket layer initialized
[   47.299508] Bluetooth: RFCOMM ver 1.11
[   52.764775] fuse init (API version 7.26)
[  337.344559] Adding 10485592k swap on /dev/sda3.  Priority:-2 extents:1 across:10485592k FS



lsmod
Module                  Size  Used by
iptable_filter         16384  0
fuse                  106496  3
rfcomm                 49152  6
cmac                   16384  1
bnep                   20480  2
hci_uart               36864  1
btbcm                  16384  1 hci_uart
serdev                 20480  1 hci_uart
bluetooth             368640  29 hci_uart,bnep,btbcm,rfcomm
ecdh_generic           28672  1 bluetooth
evdev                  24576  6
sg                     28672  0
brcmfmac              307200  0
brcmutil               16384  1 brcmfmac
cfg80211              573440  1 brcmfmac
snd_soc_pcm512x_i2c    16384  1
snd_soc_pcm512x        32768  1 snd_soc_pcm512x_i2c
rfkill                 28672  6 bluetooth,cfg80211
snd_bcm2835            32768  0
i2c_bcm2835            16384  0
snd_soc_bcm2835_i2s    16384  2
clk_hifiberry_dacpro    16384  1
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq
fixed                  16384  3
snd_soc_hifiberry_dacplus    16384  1
snd_soc_core          188416  3 snd_soc_pcm512x,snd_soc_hifiberry_dacplus,snd_soc_bcm2835_i2s
snd_compress           20480  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm                98304  6 snd_soc_pcm512x,snd_pcm_dmaengine,snd_soc_hifiberry_dacplus,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
snd_timer              32768  1 snd_pcm
snd                    69632  7 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
i2c_dev                16384  0
ip_tables              24576  1 iptable_filter
x_tables               32768  2 ip_tables,iptable_filter
ipv6                  434176  24



# lsusb
Bus 001 Device 006: ID 17ef:602d Lenovo 
Bus 001 Device 005: ID 0461:4e66 Primax Electronics, Ltd 
Bus 001 Device 007: ID 1058:0a10 Western Digital Technologies, Inc. 
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


ls -l  /lib/modules/4.14.34-v7+/kernel/sound/soc/bcm/
合計 352
-rw-r--r-- 1 root root  7784  4月 21 07:54 snd-soc-adau1977-adc.ko
-rw-r--r-- 1 root root 12552  4月 21 07:54 snd-soc-allo-boss-dac.ko
-rw-r--r-- 1 root root 10816  4月 21 07:54 snd-soc-allo-digione.ko
-rw-r--r-- 1 root root 21328  4月 21 07:54 snd-soc-allo-piano-dac-plus.ko
-rw-r--r-- 1 root root  8188  4月 21 07:54 snd-soc-allo-piano-dac.ko
-rw-r--r-- 1 root root 13748  4月 21 07:54 snd-soc-audioinjector-octo-soundcard.ko
-rw-r--r-- 1 root root 10204  4月 21 07:54 snd-soc-audioinjector-pi-soundcard.ko
-rw-r--r-- 1 root root 15204  4月 21 07:54 snd-soc-bcm2835-i2s.ko
-rw-r--r-- 1 root root 16192  4月 21 07:54 snd-soc-digidac1-soundcard.ko
-rw-r--r-- 1 root root  8288  4月 21 07:54 snd-soc-dionaudio-loco-v2.ko
-rw-r--r-- 1 root root  8032  4月 21 07:54 snd-soc-dionaudio-loco.ko
-rw-r--r-- 1 root root  8724  4月 21 07:54 snd-soc-fe-pi-audio.ko
-rw-r--r-- 1 root root  9996  4月 21 07:54 snd-soc-googlevoicehat-codec.ko
-rw-r--r-- 1 root root  8336  4月 21 07:54 snd-soc-googlevoicehat-soundcard.ko
-rw-r--r-- 1 root root  7944  4月 21 07:54 snd-soc-hifiberry-amp.ko
-rw-r--r-- 1 root root  8128  4月 21 07:54 snd-soc-hifiberry-dac.ko
-rw-r--r-- 1 root root 11584  4月 21 07:54 snd-soc-hifiberry-dacplus.ko
-rw-r--r-- 1 root root 11116  4月 21 07:54 snd-soc-hifiberry-digi.ko
-rw-r--r-- 1 root root 10776  4月 21 07:54 snd-soc-iqaudio-dac.ko
-rw-r--r-- 1 root root 10672  4月 21 07:54 snd-soc-iqaudio-digi.ko
-rw-r--r-- 1 root root  8844  4月 21 07:54 snd-soc-justboom-dac.ko
-rw-r--r-- 1 root root  9344  4月 21 07:54 snd-soc-justboom-digi.ko
-rw-r--r-- 1 root root 34432  4月 21 07:54 snd-soc-pisound.ko
-rw-r--r-- 1 root root 23748  4月 21 07:54 snd-soc-rpi-cirrus.ko
-rw-r--r-- 1 root root  7788  4月 21 07:54 snd-soc-rpi-dac.ko

-rw-r--r-- 1 root root  8476  4月 21 07:54 snd-soc-rpi-proto.ko



ls  -l  /boot/overlays
合計 1176
-rwxr-xr-x 1 root root 79565  4月 21 07:54 README
-rwxr-xr-x 1 root root  1027  4月 21 07:54 adau1977-adc.dtbo
-rwxr-xr-x 1 root root  1587  4月 21 07:54 adau7002-simple.dtbo
-rwxr-xr-x 1 root root  2425  4月 21 07:54 ads1015.dtbo
-rwxr-xr-x 1 root root  2425  4月 21 07:54 ads1115.dtbo
-rwxr-xr-x 1 root root  2426  4月 21 07:54 ads7846.dtbo
-rwxr-xr-x 1 root root  1387  4月 21 07:54 akkordion-iqdacplus.dtbo
-rwxr-xr-x 1 root root  1473  4月 21 07:54 allo-boss-dac-pcm512x-audio.dtbo
-rwxr-xr-x 1 root root  1208  4月 21 07:54 allo-digione.dtbo
-rwxr-xr-x 1 root root  1011  4月 21 07:54 allo-piano-dac-pcm512x-audio.dtbo
-rwxr-xr-x 1 root root  1585  4月 21 07:54 allo-piano-dac-plus-pcm512x-audio.dtbo
-rwxr-xr-x 1 root root  1454  4月 21 07:54 applepi-dac.dtbo
-rwxr-xr-x 1 root root  1668  4月 21 07:54 at86rf233.dtbo
-rwxr-xr-x 1 root root  2144  4月 21 07:54 audioinjector-addons.dtbo
-rwxr-xr-x 1 root root   787  4月 21 07:54 audioinjector-wm8731-audio.dtbo
-rwxr-xr-x 1 root root   575  4月 21 07:54 audremap.dtbo
-rwxr-xr-x 1 root root   449  4月 21 07:54 bmp085_i2c-sensor.dtbo
-rwxr-xr-x 1 root root   983  4月 21 07:54 dht11.dtbo
-rwxr-xr-x 1 root root  1027  4月 21 07:54 dionaudio-loco-v2.dtbo
-rwxr-xr-x 1 root root   663  4月 21 07:54 dionaudio-loco.dtbo
-rwxr-xr-x 1 root root   765  4月 21 07:54 dpi18.dtbo
-rwxr-xr-x 1 root root   789  4月 21 07:54 dpi24.dtbo
-rwxr-xr-x 1 root root   423  4月 21 07:54 dwc-otg.dtbo
-rwxr-xr-x 1 root root   856  4月 21 07:54 dwc2.dtbo
-rwxr-xr-x 1 root root  1279  4月 21 07:54 enc28j60-spi2.dtbo
-rwxr-xr-x 1 root root  1403  4月 21 07:54 enc28j60.dtbo
-rwxr-xr-x 1 root root  1562  4月 21 07:54 exc3000.dtbo
-rwxr-xr-x 1 root root  1932  4月 21 07:54 fe-pi-audio.dtbo
-rwxr-xr-x 1 root root  1437  4月 21 07:54 goodix.dtbo
-rwxr-xr-x 1 root root  1259  4月 21 07:54 googlevoicehat-soundcard.dtbo
-rwxr-xr-x 1 root root  1096  4月 21 07:54 gpio-ir-tx.dtbo
-rwxr-xr-x 1 root root  1212  4月 21 07:54 gpio-ir.dtbo
-rwxr-xr-x 1 root root  1373  4月 21 07:54 gpio-key.dtbo
-rwxr-xr-x 1 root root   901  4月 21 07:54 gpio-poweroff.dtbo
-rwxr-xr-x 1 root root  1250  4月 21 07:54 gpio-shutdown.dtbo
-rwxr-xr-x 1 root root   779  4月 21 07:54 hifiberry-amp.dtbo
-rwxr-xr-x 1 root root   655  4月 21 07:54 hifiberry-dac.dtbo
-rwxr-xr-x 1 root root  1693  4月 21 07:54 hifiberry-dacplus.dtbo
-rwxr-xr-x 1 root root  1125  4月 21 07:54 hifiberry-digi-pro.dtbo
-rwxr-xr-x 1 root root   959  4月 21 07:54 hifiberry-digi.dtbo
-rwxr-xr-x 1 root root  2468  4月 21 07:54 hy28a.dtbo
-rwxr-xr-x 1 root root  2939  4月 21 07:54 hy28b.dtbo
-rwxr-xr-x 1 root root   270  4月 21 07:54 i2c-bcm2708.dtbo
-rwxr-xr-x 1 root root  1035  4月 21 07:54 i2c-gpio.dtbo
-rwxr-xr-x 1 root root  2185  4月 21 07:54 i2c-mux.dtbo
-rwxr-xr-x 1 root root   644  4月 21 07:54 i2c-pwm-pca9685a.dtbo
-rwxr-xr-x 1 root root  4143  4月 21 07:54 i2c-rtc-gpio.dtbo
-rwxr-xr-x 1 root root  3765  4月 21 07:54 i2c-rtc.dtbo
-rwxr-xr-x 1 root root  4402  4月 21 07:54 i2c-sensor.dtbo
-rwxr-xr-x 1 root root  1182  4月 21 07:54 i2c0-bcm2708.dtbo
-rwxr-xr-x 1 root root   805  4月 21 07:54 i2c1-bcm2708.dtbo
-rwxr-xr-x 1 root root   343  4月 21 07:54 i2s-gpio28-31.dtbo
-rwxr-xr-x 1 root root  1272  4月 21 07:54 iqaudio-dac.dtbo
-rwxr-xr-x 1 root root  1511  4月 21 07:54 iqaudio-dacplus.dtbo
-rwxr-xr-x 1 root root  1326  4月 21 07:54 iqaudio-digi-wm8804-audio.dtbo
-rwxr-xr-x 1 root root  5212  4月 21 07:54 jedec-spi-nor.dtbo
-rwxr-xr-x 1 root root  1276  4月 21 07:54 justboom-dac.dtbo
-rwxr-xr-x 1 root root   955  4月 21 07:54 justboom-digi.dtbo
-rwxr-xr-x 1 root root  1348  4月 21 07:54 lirc-rpi.dtbo
-rwxr-xr-x 1 root root  1605  4月 21 07:54 mbed-dac.dtbo
-rwxr-xr-x 1 root root  1329  4月 21 07:54 mcp23017.dtbo
-rwxr-xr-x 1 root root 15229  4月 21 07:54 mcp23s17.dtbo
-rwxr-xr-x 1 root root  1833  4月 21 07:54 mcp2515-can0.dtbo
-rwxr-xr-x 1 root root  1833  4月 21 07:54 mcp2515-can1.dtbo
-rwxr-xr-x 1 root root  4237  4月 21 07:54 mcp3008.dtbo
-rwxr-xr-x 1 root root  4237  4月 21 07:54 mcp3202.dtbo
-rwxr-xr-x 1 root root  3438  4月 21 07:54 media-center.dtbo
-rwxr-xr-x 1 root root   720  4月 21 07:54 midi-uart0.dtbo
-rwxr-xr-x 1 root root   857  4月 21 07:54 midi-uart1.dtbo
-rwxr-xr-x 1 root root  1099  4月 21 07:54 mmc.dtbo
-rwxr-xr-x 1 root root   796  4月 21 07:54 mpu6050.dtbo
-rwxr-xr-x 1 root root  2850  4月 21 07:54 mz61581.dtbo
-rwxr-xr-x 1 root root  2356  4月 21 07:54 papirus.dtbo
-rwxr-xr-x 1 root root   569  4月 21 07:54 pi3-act-led.dtbo
-rwxr-xr-x 1 root root   818  4月 21 07:54 pi3-disable-bt.dtbo
-rwxr-xr-x 1 root root   265  4月 21 07:54 pi3-disable-wifi.dtbo
-rwxr-xr-x 1 root root  1446  4月 21 07:54 pi3-miniuart-bt.dtbo
-rwxr-xr-x 1 root root  2334  4月 21 07:54 pibell.dtbo
-rwxr-xr-x 1 root root  2713  4月 21 07:54 piscreen.dtbo
-rwxr-xr-x 1 root root  2617  4月 21 07:54 piscreen2r.dtbo
-rwxr-xr-x 1 root root  2454  4月 21 07:54 pisound.dtbo
-rwxr-xr-x 1 root root  1544  4月 21 07:54 pitft22.dtbo
-rwxr-xr-x 1 root root  2385  4月 21 07:54 pitft28-capacitive.dtbo
-rwxr-xr-x 1 root root  2802  4月 21 07:54 pitft28-resistive.dtbo
-rwxr-xr-x 1 root root  2802  4月 21 07:54 pitft35-resistive.dtbo
-rwxr-xr-x 1 root root  1145  4月 21 07:54 pps-gpio.dtbo
-rwxr-xr-x 1 root root  1057  4月 21 07:54 pwm-2chan.dtbo
-rwxr-xr-x 1 root root  1031  4月 21 07:54 pwm-ir-tx.dtbo
-rwxr-xr-x 1 root root   946  4月 21 07:54 pwm.dtbo
-rwxr-xr-x 1 root root  1315  4月 21 07:54 qca7000.dtbo
-rwxr-xr-x 1 root root  1922  4月 21 07:54 rotary-encoder.dtbo
-rwxr-xr-x 1 root root   489  4月 21 07:54 rpi-backlight.dtbo
-rwxr-xr-x 1 root root  3406  4月 21 07:54 rpi-cirrus-wm5102.dtbo
-rwxr-xr-x 1 root root   643  4月 21 07:54 rpi-dac.dtbo
-rwxr-xr-x 1 root root  2598  4月 21 07:54 rpi-display.dtbo
-rwxr-xr-x 1 root root  1018  4月 21 07:54 rpi-ft5406.dtbo
-rwxr-xr-x 1 root root   771  4月 21 07:54 rpi-proto.dtbo
-rwxr-xr-x 1 root root   893  4月 21 07:54 rpi-sense.dtbo
-rwxr-xr-x 1 root root   499  4月 21 07:54 rpi-tv.dtbo
-rwxr-xr-x 1 root root  1298  4月 21 07:54 rra-digidac1-wm8741-audio.dtbo
-rwxr-xr-x 1 root root  1174  4月 21 07:54 sc16is750-i2c.dtbo
-rwxr-xr-x 1 root root  1344  4月 21 07:54 sc16is752-i2c.dtbo
-rwxr-xr-x 1 root root  1875  4月 21 07:54 sc16is752-spi1.dtbo
-rwxr-xr-x 1 root root   846  4月 21 07:54 sdhost.dtbo
-rwxr-xr-x 1 root root  1729  4月 21 07:54 sdio-1bit.dtbo
-rwxr-xr-x 1 root root  1797  4月 21 07:54 sdio.dtbo
-rwxr-xr-x 1 root root   699  4月 21 07:54 sdtweak.dtbo
-rwxr-xr-x 1 root root   376  4月 21 07:54 smi-dev.dtbo
-rwxr-xr-x 1 root root  1508  4月 21 07:54 smi-nand.dtbo
-rwxr-xr-x 1 root root   981  4月 21 07:54 smi.dtbo
-rwxr-xr-x 1 root root   666  4月 21 07:54 spi-gpio35-39.dtbo
-rwxr-xr-x 1 root root   635  4月 21 07:54 spi-rtc.dtbo
-rwxr-xr-x 1 root root   919  4月 21 07:54 spi0-cs.dtbo
-rwxr-xr-x 1 root root   492  4月 21 07:54 spi0-hw-cs.dtbo
-rwxr-xr-x 1 root root  1547  4月 21 07:54 spi1-1cs.dtbo
-rwxr-xr-x 1 root root  1920  4月 21 07:54 spi1-2cs.dtbo
-rwxr-xr-x 1 root root  2293  4月 21 07:54 spi1-3cs.dtbo
-rwxr-xr-x 1 root root  1547  4月 21 07:54 spi2-1cs.dtbo
-rwxr-xr-x 1 root root  1920  4月 21 07:54 spi2-2cs.dtbo
-rwxr-xr-x 1 root root  2293  4月 21 07:54 spi2-3cs.dtbo
-rwxr-xr-x 1 root root  1968  4月 21 07:54 superaudioboard.dtbo
-rwxr-xr-x 1 root root 35594  4月 21 07:54 sx150x.dtbo
-rwxr-xr-x 1 root root  4878  4月 21 07:54 tinylcd35.dtbo
-rwxr-xr-x 1 root root   928  4月 21 07:54 uart0.dtbo
-rwxr-xr-x 1 root root   980  4月 21 07:54 uart1.dtbo
-rwxr-xr-x 1 root root   715  4月 21 07:54 upstream-aux-interrupt.dtbo
-rwxr-xr-x 1 root root  3215  4月 21 07:54 upstream.dtbo
-rwxr-xr-x 1 root root  1412  4月 21 07:54 vc4-fkms-v3d.dtbo
-rwxr-xr-x 1 root root  2367  4月 21 07:54 vc4-kms-v3d.dtbo
-rwxr-xr-x 1 root root   758  4月 21 07:54 vga666.dtbo
-rwxr-xr-x 1 root root  1251  4月 21 07:54 w1-gpio-pullup.dtbo
-rwxr-xr-x 1 root root  1116  4月 21 07:54 w1-gpio.dtbo
-rwxr-xr-x 1 root root  1080  4月 21 07:54 wittypi.dtbo





2017年8月2日水曜日

raspberry pi 3 で hostapd + dnsmasq で wifi アクセスポイントをつくる

wifi access point をつくる





なイメージです。

英語の
https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/
のとおり

最終のスクリプトは
 ./wifi-accessPoint.bat
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"


iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT  
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT 

service hostapd start  
service dnsmasq start 


必要な道具を用意します
aptitude install hostapd dnsmasq



/etc/dhcpcd.conf
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname
denyinterfaces wlan0 



ヘリポートにアドレスをふります
 /etc/network/interfaces


source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0  
iface wlan0 inet static  
    address 172.24.1.1
    netmask 255.255.255.0
    network 172.24.1.0
    broadcast 172.24.1.255



ヘリコプターがつける準備です
/etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=Pi3-AP
hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=1122334455


rsn_pairwise=CCMP



切符がないと 新幹線にはのれませんので
 /etc/dnsmasq.conf 
interface=wlan0      # Use interface wlan0  
listen-address=172.24.1.1 # Explicitly specify the address to listen on  
bind-interfaces      # Bind to the interface to make sure we aren't sending things elsewhere  
server=8.8.8.8       # Forward DNS requests to Google DNS  
domain-needed        # Don't forward short names  
bogus-priv           
dhcp-range=172.24.1.50,172.24.1.55,12h 


これにて 
wifi いう電波に乗って ヘリポートにおりたち(hostapdの役割)

dnsmasqから 切符をもらい

iptables によって新幹線にいけます


感謝です
日本語のサイトはいろいろ試しましたが駄目でした。
isc-dhcp サーバーは危なすぎます

2017年7月27日木曜日

raspbianでハイレゾを演奏する(volumio からでないよー)

a) swapを大きくする編
http://inaba.hatenablog.com/entry/2016/12/13/023251を参考にして

SWAPが少なすぎるし かつ マイクロSDメモリでは これがこわれちゃうので
(マイクロSDメモリには システムがはいってる)
SWAPを本体から 分離する

cat /etc/rc.local 

.
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
swapon /dev/sda2
service dphys-swapfile stop
exit 0






b)ラスビアンで ハイレゾ編

まず
# aptitude   update
# aptitude  upgrade
# rpi-update
をします



$ ls -l  /lib/modules/4.9.37-v7+/kernel/sound/soc/bcm/
total 356
-rw-r--r-- 1 root root  7684 Jul 20 16:02 snd-soc-adau1977-adc.ko
-rw-r--r-- 1 root root 12528 Jul 20 16:02 snd-soc-allo-boss-dac.ko
-rw-r--r-- 1 root root 10720 Jul 20 16:02 snd-soc-allo-digione.ko
-rw-r--r-- 1 root root  8592 Jul 20 16:02 snd-soc-allo-piano-dac.ko
-rw-r--r-- 1 root root 19396 Jul 20 16:02 snd-soc-allo-piano-dac-plus.ko
-rw-r--r-- 1 root root 13248 Jul 20 16:02 snd-soc-audioinjector-octo-soundcard.ko
-rw-r--r-- 1 root root 10104 Jul 20 16:02 snd-soc-audioinjector-pi-soundcard.ko
-rw-r--r-- 1 root root 13468 Jul 20 16:02 snd-soc-bcm2835-i2s.ko
-rw-r--r-- 1 root root 16092 Jul 20 16:02 snd-soc-digidac1-soundcard.ko
-rw-r--r-- 1 root root  7872 Jul 20 16:02 snd-soc-dionaudio-loco.ko
-rw-r--r-- 1 root root  8704 Jul 20 16:02 snd-soc-dionaudio-loco-v2.ko
-rw-r--r-- 1 root root  8628 Jul 20 16:02 snd-soc-fe-pi-audio.ko
-rw-r--r-- 1 root root  9896 Jul 20 16:02 snd-soc-googlevoicehat-codec.ko
-rw-r--r-- 1 root root  8240 Jul 20 16:02 snd-soc-googlevoicehat-soundcard.ko
-rw-r--r-- 1 root root  7848 Jul 20 16:02 snd-soc-hifiberry-amp.ko
-rw-r--r-- 1 root root  8028 Jul 20 16:02 snd-soc-hifiberry-dac.ko
-rw-r--r-- 1 root root 11424 Jul 20 16:02 snd-soc-hifiberry-dacplus.ko
-rw-r--r-- 1 root root 11020 Jul 20 16:02 snd-soc-hifiberry-digi.ko
-rw-r--r-- 1 root root 11180 Jul 20 16:02 snd-soc-iqaudio-dac.ko
-rw-r--r-- 1 root root 10508 Jul 20 16:02 snd-soc-iqaudio-digi.ko
-rw-r--r-- 1 root root  9204 Jul 20 16:02 snd-soc-justboom-dac.ko
-rw-r--r-- 1 root root  9180 Jul 20 16:02 snd-soc-justboom-digi.ko
-rw-r--r-- 1 root root 26244 Jul 20 16:02 snd-soc-pisound.ko
-rw-r--r-- 1 root root  9528 Jul 20 16:02 snd-soc-raspidac3.ko
-rw-r--r-- 1 root root 23584 Jul 20 16:02 snd-soc-rpi-cirrus.ko
-rw-r--r-- 1 root root  7628 Jul 20 16:02 snd-soc-rpi-dac.ko
-rw-r--r-- 1 root root  8312 Jul 20 16:02 snd-soc-rpi-proto.ko
なので


/etc/modules
----------------------------------
i2c-dev
snd-soc-hifiberry-dacplus





ls  -l  /boot/overlays
total 269
-rwxr-xr-x 1 root root  1027 Jul 20 16:02 adau1977-adc.dtbo
-rwxr-xr-x 1 root root  1587 Jul 20 16:02 adau7002-simple.dtbo
-rwxr-xr-x 1 root root  2425 Jul 20 16:02 ads1015.dtbo
-rwxr-xr-x 1 root root  2425 Jul 20 16:02 ads1115.dtbo
-rwxr-xr-x 1 root root  2426 Jul 20 16:02 ads7846.dtbo
-rwxr-xr-x 1 root root  1387 Jul 20 16:02 akkordion-iqdacplus.dtbo
-rwxr-xr-x 1 root root  1473 Jul 20 16:02 allo-boss-dac-pcm512x-audio.dtbo
-rwxr-xr-x 1 root root  1208 Jul 20 16:02 allo-digione.dtbo
-rwxr-xr-x 1 root root  1011 Jul 20 16:02 allo-piano-dac-pcm512x-audio.dtbo
-rwxr-xr-x 1 root root  1585 Jul 20 16:02 allo-piano-dac-plus-pcm512x-audio.dtbo
-rwxr-xr-x 1 root root  1668 Jul 20 16:02 at86rf233.dtbo
-rwxr-xr-x 1 root root  1972 Jul 20 16:02 audioinjector-addons.dtbo
-rwxr-xr-x 1 root root   787 Jul 20 16:02 audioinjector-wm8731-audio.dtbo
-rwxr-xr-x 1 root root   575 Jul 20 16:02 audremap.dtbo
-rwxr-xr-x 1 root root   449 Jul 20 16:02 bmp085_i2c-sensor.dtbo
-rwxr-xr-x 1 root root   983 Jul 20 16:02 dht11.dtbo
-rwxr-xr-x 1 root root   663 Jul 20 16:02 dionaudio-loco.dtbo
-rwxr-xr-x 1 root root  1027 Jul 20 16:02 dionaudio-loco-v2.dtbo
-rwxr-xr-x 1 root root   765 Jul 20 16:02 dpi18.dtbo
-rwxr-xr-x 1 root root   789 Jul 20 16:02 dpi24.dtbo
-rwxr-xr-x 1 root root   852 Jul 20 16:02 dwc2.dtbo
-rwxr-xr-x 1 root root   423 Jul 20 16:02 dwc-otg.dtbo
-rwxr-xr-x 1 root root  1403 Jul 20 16:02 enc28j60.dtbo
-rwxr-xr-x 1 root root  1279 Jul 20 16:02 enc28j60-spi2.dtbo
-rwxr-xr-x 1 root root  1932 Jul 20 16:02 fe-pi-audio.dtbo
-rwxr-xr-x 1 root root  1437 Jul 20 16:02 goodix.dtbo
-rwxr-xr-x 1 root root  1259 Jul 20 16:02 googlevoicehat-soundcard.dtbo
-rwxr-xr-x 1 root root  1036 Jul 20 16:02 gpio-ir.dtbo
-rwxr-xr-x 1 root root   901 Jul 20 16:02 gpio-poweroff.dtbo
-rwxr-xr-x 1 root root  1250 Jul 20 16:02 gpio-shutdown.dtbo
-rwxr-xr-x 1 root root   779 Jul 20 16:02 hifiberry-amp.dtbo
-rwxr-xr-x 1 root root   655 Jul 20 16:02 hifiberry-dac.dtbo
-rwxr-xr-x 1 root root  1693 Jul 20 16:02 hifiberry-dacplus.dtbo
-rwxr-xr-x 1 root root   959 Jul 20 16:02 hifiberry-digi.dtbo
-rwxr-xr-x 1 root root  1125 Jul 20 16:02 hifiberry-digi-pro.dtbo
-rwxr-xr-x 1 root root  2468 Jul 20 16:02 hy28a.dtbo
-rwxr-xr-x 1 root root  2939 Jul 20 16:02 hy28b.dtbo
-rwxr-xr-x 1 root root  1182 Jul 20 16:02 i2c0-bcm2708.dtbo
-rwxr-xr-x 1 root root   854 Jul 20 16:02 i2c1-bcm2708.dtbo
-rwxr-xr-x 1 root root   270 Jul 20 16:02 i2c-bcm2708.dtbo
-rwxr-xr-x 1 root root   991 Jul 20 16:02 i2c-gpio.dtbo
-rwxr-xr-x 1 root root  2185 Jul 20 16:02 i2c-mux.dtbo
-rwxr-xr-x 1 root root   644 Jul 20 16:02 i2c-pwm-pca9685a.dtbo
-rwxr-xr-x 1 root root  3442 Jul 20 16:02 i2c-rtc.dtbo
-rwxr-xr-x 1 root root  4143 Jul 20 16:02 i2c-rtc-gpio.dtbo
-rwxr-xr-x 1 root root  2864 Jul 20 16:02 i2c-sensor.dtbo
-rwxr-xr-x 1 root root   343 Jul 20 16:02 i2s-gpio28-31.dtbo
-rwxr-xr-x 1 root root  1272 Jul 20 16:02 iqaudio-dac.dtbo
-rwxr-xr-x 1 root root  1511 Jul 20 16:02 iqaudio-dacplus.dtbo
-rwxr-xr-x 1 root root  1326 Jul 20 16:02 iqaudio-digi-wm8804-audio.dtbo
-rwxr-xr-x 1 root root  1276 Jul 20 16:02 justboom-dac.dtbo
-rwxr-xr-x 1 root root   955 Jul 20 16:02 justboom-digi.dtbo
-rwxr-xr-x 1 root root  1348 Jul 20 16:02 lirc-rpi.dtbo
-rwxr-xr-x 1 root root  1329 Jul 20 16:02 mcp23017.dtbo
-rwxr-xr-x 1 root root 15229 Jul 20 16:02 mcp23s17.dtbo
-rwxr-xr-x 1 root root  1833 Jul 20 16:02 mcp2515-can0.dtbo
-rwxr-xr-x 1 root root  1833 Jul 20 16:02 mcp2515-can1.dtbo
-rwxr-xr-x 1 root root  4237 Jul 20 16:02 mcp3008.dtbo
-rwxr-xr-x 1 root root   720 Jul 20 16:02 midi-uart0.dtbo
-rwxr-xr-x 1 root root   857 Jul 20 16:02 midi-uart1.dtbo
-rwxr-xr-x 1 root root  1099 Jul 20 16:02 mmc.dtbo
-rwxr-xr-x 1 root root   796 Jul 20 16:02 mpu6050.dtbo
-rwxr-xr-x 1 root root  2850 Jul 20 16:02 mz61581.dtbo
-rwxr-xr-x 1 root root   569 Jul 20 16:02 pi3-act-led.dtbo
-rwxr-xr-x 1 root root   818 Jul 20 16:02 pi3-disable-bt.dtbo
-rwxr-xr-x 1 root root   265 Jul 20 16:02 pi3-disable-wifi.dtbo
-rwxr-xr-x 1 root root  1105 Jul 20 16:02 pi3-miniuart-bt.dtbo
-rwxr-xr-x 1 root root  2617 Jul 20 16:02 piscreen2r.dtbo
-rwxr-xr-x 1 root root  2713 Jul 20 16:02 piscreen.dtbo
-rwxr-xr-x 1 root root  2454 Jul 20 16:02 pisound.dtbo
-rwxr-xr-x 1 root root  1544 Jul 20 16:02 pitft22.dtbo
-rwxr-xr-x 1 root root  2385 Jul 20 16:02 pitft28-capacitive.dtbo
-rwxr-xr-x 1 root root  2802 Jul 20 16:02 pitft28-resistive.dtbo
-rwxr-xr-x 1 root root  2802 Jul 20 16:02 pitft35-resistive.dtbo
-rwxr-xr-x 1 root root  1043 Jul 20 16:02 pps-gpio.dtbo
-rwxr-xr-x 1 root root  1057 Jul 20 16:02 pwm-2chan.dtbo
-rwxr-xr-x 1 root root   946 Jul 20 16:02 pwm.dtbo
-rwxr-xr-x 1 root root  1315 Jul 20 16:02 qca7000.dtbo
-rwxr-xr-x 1 root root  1301 Jul 20 16:02 raspidac3.dtbo
-rwxr-xr-x 1 root root 66511 Jul 20 16:02 README
-rwxr-xr-x 1 root root  1275 Jul 20 16:02 rotary-encoder.dtbo
-rwxr-xr-x 1 root root   489 Jul 20 16:02 rpi-backlight.dtbo
-rwxr-xr-x 1 root root  3406 Jul 20 16:02 rpi-cirrus-wm5102.dtbo
-rwxr-xr-x 1 root root   643 Jul 20 16:02 rpi-dac.dtbo
-rwxr-xr-x 1 root root  2524 Jul 20 16:02 rpi-display.dtbo
-rwxr-xr-x 1 root root   462 Jul 20 16:02 rpi-ft5406.dtbo
-rwxr-xr-x 1 root root   771 Jul 20 16:02 rpi-proto.dtbo
-rwxr-xr-x 1 root root   893 Jul 20 16:02 rpi-sense.dtbo
-rwxr-xr-x 1 root root   499 Jul 20 16:02 rpi-tv.dtbo
-rwxr-xr-x 1 root root  1298 Jul 20 16:02 rra-digidac1-wm8741-audio.dtbo
-rwxr-xr-x 1 root root  1174 Jul 20 16:02 sc16is750-i2c.dtbo
-rwxr-xr-x 1 root root  1875 Jul 20 16:02 sc16is752-spi1.dtbo
-rwxr-xr-x 1 root root   846 Jul 20 16:02 sdhost.dtbo
-rwxr-xr-x 1 root root  1078 Jul 20 16:02 sdio-1bit.dtbo
-rwxr-xr-x 1 root root  1116 Jul 20 16:02 sdio.dtbo
-rwxr-xr-x 1 root root   699 Jul 20 16:02 sdtweak.dtbo
-rwxr-xr-x 1 root root   376 Jul 20 16:02 smi-dev.dtbo
-rwxr-xr-x 1 root root   981 Jul 20 16:02 smi.dtbo
-rwxr-xr-x 1 root root  1508 Jul 20 16:02 smi-nand.dtbo
-rwxr-xr-x 1 root root   919 Jul 20 16:02 spi0-cs.dtbo
-rwxr-xr-x 1 root root   492 Jul 20 16:02 spi0-hw-cs.dtbo
-rwxr-xr-x 1 root root  1547 Jul 20 16:02 spi1-1cs.dtbo
-rwxr-xr-x 1 root root  1920 Jul 20 16:02 spi1-2cs.dtbo
-rwxr-xr-x 1 root root  2293 Jul 20 16:02 spi1-3cs.dtbo
-rwxr-xr-x 1 root root  1547 Jul 20 16:02 spi2-1cs.dtbo
-rwxr-xr-x 1 root root  1920 Jul 20 16:02 spi2-2cs.dtbo
-rwxr-xr-x 1 root root  2293 Jul 20 16:02 spi2-3cs.dtbo
-rwxr-xr-x 1 root root   666 Jul 20 16:02 spi-gpio35-39.dtbo
-rwxr-xr-x 1 root root   635 Jul 20 16:02 spi-rtc.dtbo
-rwxr-xr-x 1 root root  4878 Jul 20 16:02 tinylcd35.dtbo
-rwxr-xr-x 1 root root   980 Jul 20 16:02 uart1.dtbo
-rwxr-xr-x 1 root root  1412 Jul 20 16:02 vc4-fkms-v3d.dtbo
-rwxr-xr-x 1 root root  3108 Jul 20 16:02 vc4-kms-v3d.dtbo
-rwxr-xr-x 1 root root   758 Jul 20 16:02 vga666.dtbo
-rwxr-xr-x 1 root root  1116 Jul 20 16:02 w1-gpio.dtbo
-rwxr-xr-x 1 root root  1251 Jul 20 16:02 w1-gpio-pullup.dtbo
-rwxr-xr-x 1 root root  1080 Jul 20 16:02 wittypi.dtbo
なので


/boot/config.txt
------------------------------------------
dtoverlay=hifiberry-dacplus
dtparam=audio=on




●あとはi2s-DACを常用にするために
 メニューからPreferences > Audio Device Settingsを選びます。
 デフォルトではSound card の欄にはbcm2835 ALSA(Alsa mixer)しか出ていませんが、HypaerberryなんたらDAC(Alsa mixer)が選べます。
 Hypaerberryなんたら(Alsa mixer)を選び、Select Contorolsをクリックすると、Hypaerberryなんたらの機能が出るので、Analogueにチェックしました。
DSP Proguramをチェックすると、内部のフィルタなどの制御ができます。
 この設定をデフォルトにするため、Make Defaultをクリックします。
 OKを押します。
 これ以降、HDMIではなくi2s-DACボードから音が出ます。



1)日本語環境 
素描だけ

pi の パスワードは raspberry
sudo su で root権限になれる

aptitude search ipa | grep gothic ー>fonts-ipafont-gothic

aptitude install fcitx-mozc im-config zenity

dpkg-revonfigure locales

dpkg-revonfigure tzdata

nano /etc/defaults/keyboard




2)wifi access point をつくる

ただ 英語の
https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/
のとおり

最終のスクリプトは
 ./wifi-accessPoint.bat
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"


iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT  
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT 

service hostapd start  
service dnsmasq start 



aptitude install hostapd dnsmasq



/etc/dhcpcd.conf


hostname

clientid

persistent

option rapid_commit

option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers

require dhcp_server_identifier

slaac private

nohook lookup-hostname




denyinterfaces wlan0 



 /etc/network/interfaces


source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual


allow-hotplug wlan0  
iface wlan0 inet static  
    address 172.24.1.1
    netmask 255.255.255.0
    network 172.24.1.0
    broadcast 172.24.1.255


 /etc/dnsmasq.conf 
interface=wlan0      # Use interface wlan0  
listen-address=172.24.1.1 # Explicitly specify the address to listen on  
bind-interfaces      # Bind to the interface to make sure we aren't sending things elsewhere  
server=8.8.8.8       # Forward DNS requests to Google DNS  
domain-needed        # Don't forward short names  
bogus-priv           
dhcp-range=172.24.1.50,172.24.1.55,12h 







3)NGINX


nginxの change rootは ー>  /var/www/html/


/etc/nginx/nginx.conf
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
auth_basic "Restricted";
auth_basic_user_file /usr/share/nginx/.htpasswd;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}

./comment-out.bat /var/www/html/test/pre.bat 
for x in ` ls *.mp4 `
do
echo "<a href=$x > $x </a>   </p> </p>"
done