LoginSignup
3
3

More than 3 years have passed since last update.

raspberry pi にpiCoreを入れる

Last updated at Posted at 2020-04-14

SDにいれて、起動後

tc@box:~$ sudo fdisk -u /dev/mmcblk0

Command (m for help): p ←★
Disk /dev/mmcblk0: 489 MB, 513277952 bytes, 1002496 sectors
489 cylinders, 64 heads, 32 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/mmcblk0p1    4,0,1       37,63,32          8192      77823      69632 34.0M  c Win95 FAT32 (LBA)
/dev/mmcblk0p2    38,0,1      48,63,32         77824     100351      22528 11.0M 83 Linux

Command (m for help): d ←★
2 ←★

Command (m for help): n 
Command action
   e   extended
   p   primary partition (1-4)
p ←★
Partition number (1-4): 2 ←★
First sector (32-1002495, default 32): 77824 ←★2番めのStartLBAの値
Last sector or +size or +sizeM or +sizeK (77824-1002495, default 1002495): Using default value 1002495 ←★デフォルトでOK

Command (m for help): w ←★
The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
tc@box:~$ sudo reboot ←★
sudo resize2fs /dev/mmcblk0p2

ホスト名

sudo vi /opt/bootsync.sh

/usr/bin/sethostname box

/usr/bin/sethostname hogehoge

usb-camera

tce-load -wi v4l-dvb-4.9.22-piCore.tcz
tce-load -wi libv4l2.tcz
tce-load -wi fontconfig.tcz
tce-load -wi ffmpeg.tcz
ffmpeg -f video4linux2 -s 640x480 -i /dev/video0 -vframes 1 ./test.jpg

ssh

sudo vi /usr/local/etc/ssh/sshd_config

ラズパイカメラ

sudo mkdir /boot && sudo mount -t vfat /dev/mmcblk0p1 /boot/ && sudo vi /boot/config.txt

[ALL]の直後に下記を追記

gpu_mem=128
start_file=start_x.elf
fixup_file=fixup_x.dat
sudo vi /opt/bootlocal.sh

chmod 777 /dev/vchiq
chmod 777 /dev/vcsm

を追記

filetool.sh -b
tce-load -wi rpi-vc.tcz
raspistill -o test.jpg

python

tce-load -iw python3.6
wget https://bootstrap.pypa.io/get-pip.py
sudo -E -H python3.6 get-pip.py
sudo -E -H pip3.6 install requests
tce-load -wi python3.6-RPi.GPIO.tcz 
>>> import RPi.GPIO as GPIO
vi /opt/.filetool.lst

usr/local/lib/python3.6/site-packages/

を追記

filetool.sh -b

tce-load -wi alsa-utils.tcz
aplay -l
amixer cset numid=3 1
aplay --duration=5 crows1.wav 

X系

tce-load -iw TC.tcz
startx

参考

https://github.com/SergiSM/Raspberry/wiki/piCore
https://shrimp.marokun.net/wiki/?TinyCoreLinux

apt的なもの

tce

busybox-httpd をいれても良いかも

ログインメッセージを変える

vi /etc/motd

でイジってから

vi /opt/.filetool.lst

etc/motd

を追記して

filetool.sh -b
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3