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
http://www.denshi.club/pc/audio/raspberry-pii2s-dac.html より
sudo apt-get -y update
sudo apt-get -y upgrade
sudo rpi-update
$ ls -l /lib/modules/4....-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
ゆえ
./comment-out.bat /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
ゆえ
dtoverlay=hifiberry-dacplus
dtparam=audio=on
●i2s-DACを常用にする設定
設定
から
Preferences > Audio Device Settingsを選びます。
から
Preferences > Audio Device Settingsを選びます。
デフォルトではSound card の欄にはbcm2835 ALSA(Alsa mixer)しか出ていませんが、
なんたらdacplus(Alsa mixer)なんたら
が選べます。
なんたらdacplus(Alsa mixer)なんたら
が選べます。
Hypaerberryなんたら(Alsa mixer)を選び、
コントロールを選択をクリックすると、
Analogueにチェックしました。
DSP Proguramをチェックすると、内部のフィルタなどの制御ができます。
コントロールを選択をクリックすると、
Analogueにチェックしました。
この設定をデフォルトにするため、Make Defaultをクリックします。 OKを押します。
これ以降、HDMIではなくi2s-DACから音が出ます。
あとは日本語環境
素描だけ
pi の パスワードは raspberry
sudo su で root権限になれる
pi の パスワードは raspberry
sudo su で root権限になれる
aptitude install fcitx-mozc im-config zenity
locale tzdata keyboard は設定からいける
stretch でもいけるかは未確認
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
/etc/hostapd/hostapd.conf
# This is the name of the WiFi interface we configured above
interface=wlan0
# Use the nl80211 driver with the brcmfmac driver
driver=nl80211
# This is the name of the network
ssid=myAP
# Use the 2.4GHz band
hw_mode=g
# Use channel 6
channel=6
# Enable 802.11n
ieee80211n=1
# Enable WMM
wmm_enabled=1
# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
# Accept all MAC addresses
macaddr_acl=0
# Use WPA authentication
auth_algs=1
# Require clients to know the network name
ignore_broadcast_ssid=0
# Use WPA2
wpa=2
# Use a pre-shared key
wpa_key_mgmt=WPA-PSK
# The network passphrase
wpa_passphrase=1122334455
# Use AES, instead of TKIP
rsn_pairwise=CCMP
# This is the name of the WiFi interface we configured above
interface=wlan0
# Use the nl80211 driver with the brcmfmac driver
driver=nl80211
# This is the name of the network
ssid=myAP
# Use the 2.4GHz band
hw_mode=g
# Use channel 6
channel=6
# Enable 802.11n
ieee80211n=1
# Enable WMM
wmm_enabled=1
# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
# Accept all MAC addresses
macaddr_acl=0
# Use WPA authentication
auth_algs=1
# Require clients to know the network name
ignore_broadcast_ssid=0
# Use WPA2
wpa=2
# Use a pre-shared key
wpa_key_mgmt=WPA-PSK
# The network passphrase
wpa_passphrase=1122334455
# Use AES, instead of TKIP
rsn_pairwise=CCMP
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
rootを USBハードディスクにおく
ハードディスクを
fdisk -l /dev/sda
Device Boot Start End Sectors Size Id Type
/dev/sda1 8390656 156301485 147910830 70.5G 83 Linux
/dev/sda2 2048 8390655 8388608 4G 82 Linux swap / Solaris
のようにします。
それから
ハードディスクをマウントします。
mount /dev/sda1 /ma1
ちなみに
root@raspberrypi:/home/pi# blkid /dev/sda1
/dev/sda1: UUID="ce803fd0-63e3-4b0e-a744-78379130bddf" TYPE="ext4" PARTUUID="4bdb66a6-01"
root@raspberrypi:/home/pi# blkid /dev/sda2
/dev/sda2: UUID="d24f2945-79db-4b5b-adae-761194f7ede1" TYPE="swap" PARTUUID="4bdb66a6-02"
そして 2つのスクリプトをはしらせます
1) for x in bin etc home lib opt root run sbin srv tmp usr var man debian-binary
do
mkdir -p /ma1/$x
rsync -avHx /$x/ /ma1/$x/
done
2) for y in boot dev sys mnt proc
do
mkdir -p /ma1/$y
done
それから
/boot/cmdline.txt を書き換えます。
cp /boot/cmdline.txt /boot/cmdline.txt-ori
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=4bdb66a6-01 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
次に ハードディスクの
/ma1/etc/fstab を書き換えます。
cp /ma1/etc/fstab /ma1/etc/fstab-ori
proc /proc proc defaults 0 0
PARTUUID=310ad60d-01 /boot vfat defaults 0 2
PARTUUID=4bdb66a6-01 / ext4 defaults,noatime 0 1
PARTUUID=4bdb66a6-02 none swap sw 0 0
/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
umount /media/pi/62ca0b6d-6291-4c40-b1fd-11bc291e4a38
umount /media/pi/62ca0b6d-6291-4c40-b1fd-11bc291e4a38
umount /media/pi/62ca0b6d-6291-4c40-b1fd-11bc291e4a38
exit 0
以上で
free
total used free shared buffers cached
Mem: 945512 298388 647124 13740 18664 167004
-/+ buffers/cache: 112720 832792
Swap: 4194300 0 4194300
root@raspberrypi:/home/pi# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 72268964 5655720 62899092 9% /
devtmpfs 468148 0 468148 0% /dev
tmpfs 472756 0 472756 0% /dev/shm
tmpfs 472756 6492 466264 2% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 472756 0 472756 0% /sys/fs/cgroup
/dev/mmcblk0p1 42030 21435 20595 51% /boot
tmpfs 94552 0 94552 0% /run/user/1000
なお もとのSDだけの運用に戻すには
cp /boot/cmdline.txt-ori /boot/cmdline.txt
にしたらいいだけです
https://www.blogger.com/blogger.g?blogID=7872769022530501383#editor/target=post;postID=4201772767215641358;onPublishedMenu=allposts;onClosedMenu=allposts;postNum=4;src=link
ホームページ
./comment-out.bat pre.bat
for y in `ls *.jpg`
do
jhead -nf%Y-%m-%d-%H%M $y
done
echo ' </p> </p> </p> </p> </p> '
echo '--- movie ---動画 </p> </p> '
for x in ` ls *.mp4 `
do
echo "<a href=$x > $x </a> </p> </p>"
done
echo '=============================== '
echo ' </p> </p> </p> </p> </p> </p> </p> </p> </p> </p> '
echo '--- photo ---写真 </p> </p> '
for x in ` ls *.jpg `
do
echo "<a href=$x > $x </a> </p> </p>"
done
# ./comment-out.bat UTF8-2-EUCJP.bat
iconv -f UTF-8 -t EUCJP < index.html > output.txt ; cp output.txt index.html
mount /dev/sda1 /ma1
ちなみに
root@raspberrypi:/home/pi# blkid /dev/sda1
/dev/sda1: UUID="ce803fd0-63e3-4b0e-a744-78379130bddf" TYPE="ext4" PARTUUID="4bdb66a6-01"
root@raspberrypi:/home/pi# blkid /dev/sda2
/dev/sda2: UUID="d24f2945-79db-4b5b-adae-761194f7ede1" TYPE="swap" PARTUUID="4bdb66a6-02"
そして 2つのスクリプトをはしらせます
1) for x in bin etc home lib opt root run sbin srv tmp usr var man debian-binary
do
mkdir -p /ma1/$x
rsync -avHx /$x/ /ma1/$x/
done
2) for y in boot dev sys mnt proc
do
mkdir -p /ma1/$y
done
それから
/boot/cmdline.txt を書き換えます。
cp /boot/cmdline.txt /boot/cmdline.txt-ori
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=4bdb66a6-01 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
次に ハードディスクの
/ma1/etc/fstab を書き換えます。
cp /ma1/etc/fstab /ma1/etc/fstab-ori
proc /proc proc defaults 0 0
PARTUUID=310ad60d-01 /boot vfat defaults 0 2
PARTUUID=4bdb66a6-01 / ext4 defaults,noatime 0 1
PARTUUID=4bdb66a6-02 none swap sw 0 0
/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
umount /media/pi/62ca0b6d-6291-4c40-b1fd-11bc291e4a38
umount /media/pi/62ca0b6d-6291-4c40-b1fd-11bc291e4a38
umount /media/pi/62ca0b6d-6291-4c40-b1fd-11bc291e4a38
exit 0
free
total used free shared buffers cached
Mem: 945512 298388 647124 13740 18664 167004
-/+ buffers/cache: 112720 832792
Swap: 4194300 0 4194300
root@raspberrypi:/home/pi# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 72268964 5655720 62899092 9% /
devtmpfs 468148 0 468148 0% /dev
tmpfs 472756 0 472756 0% /dev/shm
tmpfs 472756 6492 466264 2% /run
tmpfs 5120 4 5116 1% /run/lock
tmpfs 472756 0 472756 0% /sys/fs/cgroup
/dev/mmcblk0p1 42030 21435 20595 51% /boot
tmpfs 94552 0 94552 0% /run/user/1000
なお もとのSDだけの運用に戻すには
cp /boot/cmdline.txt-ori /boot/cmdline.txt
にしたらいいだけです
https://www.blogger.com/blogger.g?blogID=7872769022530501383#editor/target=post;postID=4201772767215641358;onPublishedMenu=allposts;onClosedMenu=allposts;postNum=4;src=link
ホームページ
./comment-out.bat pre.bat
for y in `ls *.jpg`
do
jhead -nf%Y-%m-%d-%H%M $y
done
echo ' </p> </p> </p> </p> </p> '
echo '--- movie ---動画 </p> </p> '
for x in ` ls *.mp4 `
do
echo "<a href=$x > $x </a> </p> </p>"
done
echo '=============================== '
echo ' </p> </p> </p> </p> </p> </p> </p> </p> </p> </p> '
echo '--- photo ---写真 </p> </p> '
for x in ` ls *.jpg `
do
echo "<a href=$x > $x </a> </p> </p>"
done
# ./comment-out.bat UTF8-2-EUCJP.bat
iconv -f UTF-8 -t EUCJP < index.html > output.txt ; cp output.txt index.html