Raspberry Piãå±ããï¼
話é¡ã®ååºãµã¤ãºPCãRaspberry Piãããããå±ããï¼
Raspberry Pi
Raspberry Piã¯ååºãµã¤ãºã®ã·ã³ã°ã«ãã¼ãPCã
CPUã¯ARM 700MHzãã¡ã¢ãªã¯æè¿ã®model Bã ã¨512MBã§ããã£ã¹ã¯ã¯ãªãã¦SDã«ã¼ãã使ç¨ããããã®ä»ãUSBãã¼ãã2ã¤ã«LANãã¼ããHDMIã§ãã£ã¹ãã¬ã¤ã«ç¹ãããã«ãªã£ã¦ãããé»æºãUSBãã給é»ãæ®éã«Linuxãåãã¦ãããã§ãã¦ãå¤æ®µ35ãã«ã¨ãªã¼ãºããã«ã ã£ããããã大人æ°ããã¦æ³¨æãã¦ããªããªãå±ããªãã¨ãã
ã¨ããããã§ããã¡ã«ãããããå±ããã®ã§æ©éç«ã¡ä¸ãã¦ã¿ããã
èµ·åSDã«ã¼ãæºåã®é¨åã¯Macã§ã®ä½æ¥è¨é²ã
SDã«ã¼ãã«OSã¤ã¡ã¼ã¸ãæ¸ãè¾¼ã
Raspberry Piのダウンロードページããã好ã¿ã®ãã®ãé¸ãã§ãddã³ãã³ãã¨ãWin32DiskImagerã§SDã«ã¼ãã«æ¸ãè¾¼ãã
Archã¯VMã§ã¡ããã£ã¨ãã触ã£ããã¨ãªãã¦ããã»ã©è©³ãããªãã®ã§ãç¡é£ã«Debianãã¼ã¹ã®Raspbianã«ããã
Oracle JVMã使ç¨ããå ´åã¯Soft-floatçã使ããªãã¨ã ãããããã ãã©ãOpenJDKã®å ´åã¯ã©ããªãã§ããï¼ãããã¾ããï¼
ã¾ãè²ã
試ãã¦ã¿ããã£ã¦ãã¨ã§æ®éã®æ¹ãé¸æãã¦ã¿ããtorrentã§OSãã³ãã¼ããªã¼ãã
Macã®å ´åãSDã«ã¼ããã«ã¼ããªã¼ãã¼ã«æ¿ãã¨èªåçã«ãã¦ã³ããããã¨æãã®ã§ãããããã¢ã³ãã¦ã³ãããã
ã«ã¼ãã®ååãå¤ãã¨ãã¨ãããããããã©ããæ¶ãããã©ã
$ df -h Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk0s2 238Gi 140Gi 97Gi 60% 36833943 25470927 59% / devfs 185Ki 185Ki 0Bi 100% 641 0 100% /dev map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home /dev/disk2s1 7.5Gi 2.2Mi 7.5Gi 1% 0 0 100% /Volumes/RASPBIAN âããã¤ã ã¼ï¼ $ diskutil unmount /dev/disk2s1
ããã¤ã¹ã¯ç°å¢ã«ãã£ã¦ç°ãªãã®ã§åèªã§ç¢ºèªããããããã§ã¯/dev/disk2ã ã£ãã
ãã§ãrawããã¤ã¹ã®ã»ããéããããã®ã§rawããã¤ã¹ã§æå®ãã*1ãé ã«"r"ãã¤ããã°ããã
ã¡ãªã¿ã«ããã§ããã¤ã¹ãééããã¨å¤§å¤ãªãã¨ã«ãªãã®ã§ä¸å®ãªãdiskutil infoã§ç¢ºèªãã¦ããã¨ããã
$ diskutil info /dev/rdisk2 Device Identifier: disk2 Device Node: /dev/disk2 Part of Whole: disk2 Device / Media Name: APPLE SD Card Reader Media : :
ãããSD Card Reader Mediaãªã®ã§å¤§ä¸å¤«ããã
ã§ã¯è½ã¨ãã¦ããzipãå±éãã¦åºã¦ããimgãæ¸ãè¾¼ãã
sudo dd bs=1m if=2012-12-16-wheezy-raspbian.img of=/dev/rdisk2
ãã°ãæéãããããLinuxãªãSIGUSR1ãMacãBSDãªãSIGINFO(Ctrl+T)ã§é²æç¶æ³ã確èªã§ããã
Macãªã®ã§Ctrl+Tãæ¼ãã¨ãããªæãã§ç¾å¨ã®ç¶æ³ã表示ãããã
load: 0.33 cmd: dd 11655 uninterruptible 0.00u 0.28s 230+0 records in 229+0 records out 240123904 bytes transferred in 15.685685 secs (15308474 bytes/sec)
ãã°ããå¾ ã£ã¦ãã¨æ¸ãè¾¼ã¿ãå®äºããããã¡ã®ç°å¢ã§ã¯2åãããã ã£ãã
1850+0 records in 1850+0 records out 1939865600 bytes transferred in 122.027198 secs (15896994 bytes/sec)
Raspberry Piã®èµ·åã¨åæè¨å®
åºæ¥ä¸ãã£ãSDã«ã¼ããRaspberry Piã«æ¿ãã¦ãå種ã±ã¼ãã«ãç¹ãã§èµ·åã
ã¹ã¤ããã¨ããªãã®ã§é»æºç¨USBã±ã¼ãã«ãã¤ãªãã¨èµ·åããã
èµ·åããã¼ï¼ã©ãºããªã¼ã®ãã¼ã¯ãããããã
ç¡äºã«èµ·åããã¨åæè¨å®ç»é¢ã表示ãããããã®ç»é¢ã¯å¾ããraspi-configãå®è¡ãããã¨ã§å¼ã³åºããã
æä½ã¯ã«ã¼ã½ã«ãã¼ã®ä¸ä¸ã§é
ç®ç§»åãEnterã§æ±ºå®ããã¿ã³ã¨ãã®ãã©ã¼ã«ã¹ã®ç§»åã¯Tabã¨ãã£ãæãã
ã¨ããããupdateãããã¨ããããããªãã§ãããããèªåã¯ããå¿ããï½
expand_rootfs
ã«ã¼ããã¼ãã£ã·ã§ã³ãæ¡å¼µããã
å
ã»ã©æ¸ãè¾¼ãã Raspbianã¯2GBã®ã¤ã¡ã¼ã¸ãªã®ã§ãã®ã¾ã¾ã ã¨2GBã®å®¹éãã使ããªããã2GBããã大ããSDã«ã¼ãã使ç¨ãã¦ããå ´åã¯ãããã§å®¹éå
¨ä½ã使ç¨ããããã«è¨å®ã§ãããè¿·ããå®è¡ãè¨å®ã¯æ¬¡åèµ·åæã«åæ ãããã
åèµ·åããæã«ãµã¤ãºã®å¤æ´å¦çãè¡ãããããããªã¼ãæéããããã®ã§ç¦ããªãããã«ã
"Performing an on-line resize of ã"ã¿ãããªè¡¨ç¤ºã®é¨åã§å°äººãããé å¼µã£ã¦ãã¾ãã
overscan
ç»é¢ã®ç«¯ãå°ã空ããè¨å®ããããç»é¢ã®å¨å²ãåãããããªå ´åã«è¨å®ããã®ããªï¼ä¸è¦ãªã®ã§ã¹ã«ã¼ã
configure_keyboard
ãã¼ãã¼ãã®é
åãè¨å®ããã
èªåã¯"Generic 105-key (Intl) PC" â "Other" â "Japanese" â "Japanese (ODAG 109A)"ã¨é¸æãã¦ãã£ãã
ãã®å¾ã®AltGrãã¼ã¨ãComposeãã¼ã¯ãªãã®ãã¨ãããããªãã®ã§ãdefaultã¨ãnoã¨ããé¸ãã§ãããã
ã©ããè¨å®ãçµãã£ããsshã§ç¹ããã ãããã¼ãã¼ããªãã¦ã©ãã§ãããï½
Xãµã¼ãè½ã¨ããã¤ãNoã§ããããªã
change_pass
piã¦ã¼ã¶ï¼åæã¦ã¼ã¶ï¼ã®ãã¹ã¯ã¼ããå¤æ´ãããå¤ãã¦ãããã
ã¡ãªã¿ã«åæã¢ã«ã¦ã³ãã¯ã¤ã¡ã¼ã¸ã®ãã¦ã³ãã¼ããã¼ã¸ã«æ¸ãã¦ãã£ããã
change_locale
ãã±ã¼ã«ã®è¨å®ã"ja_JP.UTF-8"ã«ãããã¨ããã ãã©ãæ¥æ¬èªãã©ã³ããå
¥ã£ã¦ãªãã®ã§ãä»ããã¨æååããã¦å¤§å¤ãªãã¨ã«ãªãã®ã§ãã£ã¨ææ
¢ãã¦å¾åãã«ãããã
change_timezone
ã¿ã¤ã ã¾ã¼ã³ã®è¨å®ã"Asia" â "Tokyo"ã¨ãã¦ããã
memory_split
CPUã¨GPUã¸ã®ã¡ã¢ãªé
åãè¨å®ãããããã§è¨å®ããåãGPUã«å²ãå½ã¦ãããæ®ããCPUã«å²ãå½ã¦ãããã
512MBçã¯ããã©ã«ãå¤ã64MBã¨ãªã£ã¦ãããã¨ããããããã©ã«ãã®ã¾ã¾ã«ãã¦ãããã
overclock
ãªã¼ãã¼ã¯ããã¯ã®è¨å®ãããããªãã§ããã
boot_behaviour
ç´æ¥GUIã§èµ·åãããã©ãããã¾ã ã¾ã ã³ã³ã½ã¼ã«ã§ä½æ¥ãããã®ã§Noã«ãã¦ããã
ã¡ãªã¿ã«Noã®å ´åã¯ã³ã³ã½ã¼ã«ã§startxãå®è¡ããã°ãã¹ã¯ããããèµ·åããã
update
ãã®è¨å®ãã¼ã«(raspi-config)ã®ææ°çãããã°æ´æ°ããã
ã¨ãããããã£ã¦ã¿ããã©ãæåã«ããã°ããã£ãï½
ä¸éãè¨å®ãã¦Finishãé¸æããã¨åèµ·åãexpand_rootfsããã£ã人ã¯ã ãã¶å¾
ããããã
ã¡ãªã¿ã«ããã§è¨å®ããå
容ã¯/root/config.txtã«ä¿åããã模æ§ã
ã¢ãããã¼ãã¨ã
ç¡äºã«ãµã¤ãºæ¡å¼µãçµãã£ã¦ããã³ããã表示ãããããpiã¦ã¼ã¶ã§ãã°ã¤ã³ãã¦ãã¨ã¯æ®éã«ä½¿ãã ãã
ãªã®ã§ã¨ããããã¢ãããã¼ããã¦ããã
sudo apt-get update sudo apt-get upgrade
æ¥æ¬èªåã¨ã
ååè¨å®ã®æã«ãã£ã¨ããããæ¥æ¬èªåãã
ã¾ãã¯ãã©ã³ããapt-cache search font japaneseã¨ãããã¨ããããåºã¦ããã®ã§ã好ã¿ã§ã¤ã³ã¹ãã¼ã«ã
sudo apt-get install fonts-ipafont ttf-vlgothic xfonts-intl-japanese xfonts-intl-japanese-big
次ã«æ¥æ¬èªå ¥åãmozc使ããããã©èª¿ã¹ãæ°åããªãã®ã§Anthyã§ã
sudo apt-get install ibus-anthy
ããã¦æå¾ã«ãã±ã¼ã«å¤æ´ã
ãã£ãã®raspi-configã§ããããã©ã
sudo dpkg-reconfigure locales
ããã©ã«ãã ã¨en_GB.UTF-8ãæå¹ã«ãªã£ã¦ãããã¨ããããen_US.UTF-8ã¨ja_JP.UTF-8ã追å ããã
ã·ã¹ãã ã®ãã±ã¼ã«ã¯ã¨ããããen_US.UTF-8ã«ãã¦ãããã
ã§ã.profileã§$LANGã«è¨å®ãããã¨ã«ããã
echo "export LANG=ja_JP.UTF-8" >>~/.profile
ããã¦ãã¹ã¯ãããã¸
ãããã§ä¸æ¦åèµ·åãã¦ã
sudo reboot
ãã°ã¤ã³ããããããããstartx!
startx
ãã¹ã¯ãããããã¼ï¼
ä¸å¤®ã«é®åº§ããã©ãºããªã¼ï¼å£ç´ï¼ãå³ã¯åã®Pi Storeã
ã¦ã¼ã¶è¿½å
ãã¤ã¾ã§ãpiã¦ã¼ã¶ã¨ããã®ããããªã®ã§ãèªåç¨ã¦ã¼ã¶ã追å ããã
sudo adduser pasela
piã¦ã¼ã¶ãå
¥ã£ã¦ãã®ã¨åãã°ã«ã¼ãã«å
¥ãã¦ããã
ãªããè²ã
å
¥ã£ã¦ãªãã¨Xããã¾ãåããªãã
sudo vigr # piãå ¥ã£ã¦ãã®ã¨åãã°ã«ã¼ãã«ã²ãããèªåã足ãã¦ããã sudo vigr -s # ãã£ãã¨åãã
piã¦ã¼ã¶ãããã°ã¢ã¦ããã¦å
¥ãç´ãã
piã¦ã¼ã¶ã¿ããã«ãã¹ã¯ãããã«ã¢ã¤ã³ã³ãé
ç½®ããã¦ãªãã¦ããã¿ããâ¦ãã¾ããããã
åè
*1:diskãblock deviceã§rdiskãcharacter deviceãããã