2024.02.19 (월)
ubuntu@ubuntu09:~/pi_bsp$ mkdir rootfs ; cd rootfs
ubuntu@ubuntu09:~/pi_bsp/rootfs$ mkdir yocto ; cd yocto
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto$ sudo apt update //필수 패키지 설치
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto$ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm python zstd liblz4-tool
임베디드 시스템은 대부분 파일 시스템이 미니멀함
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto$ git clone -b kirkstone git://git.yoctoproject.org/poky.git
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto$ ls
poky
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto$ cd poky
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto/poky$ git clone -b kirkstone git://git.yoctoproject.org/meta-raspberrypi
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto/poky$ source oe-init-build-env
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto/poky/build$ vi conf/local.conf
38 #MACINE ??= "qemux86-64"
39 MACINE ??= "raspberrypi4"
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto/poky/build$ vi conf/bblayers.conf
12 /home/ubuntu/pi_bsp/rootfs/yocto/poky/meta-raspberrypi \
ubuntu@ubuntu09:~/pi_bsp/rootfs/yocto/poky/build$ bitbake core-image-minimal
NOOBS(New Out Of Box Software)는 라즈베리 파이를 위한 쉬운 운영체제 설치 관리자이다.
ubuntu@ubuntu09:~/pi_bsp/rootfs$ wget https://downloads.raspberrypi.org/NOOBS_latest
ubuntu@ubuntu14:~/pi_bsp/rootfs$ unzip -d noobs NOOBS_latest
ubuntu@ubuntu14:~/pi_bsp/rootfs$ cd noobs/os/RaspiOS_Full_armhf/
ubuntu@ubuntu14:~/pi_bsp/rootfs/noobs/os/RaspiOS_Full_armhf$ mkdir rootfs
ubuntu@ubuntu14:~/pi_bsp/rootfs/noobs/os/RaspiOS_Full_armhf$ tar xvfp root.tar.xz -C ./rootfs/
home directory에서
$ vi .profile
맨 밑에 코드 추가
28 if [ -f /mnt/nfs.sh ] ; then
29 . /mnt/nfs.sh
30 fi
nfs.sh 파일 만들고 코드 추가해주기
$ cd /mnt ; sudo mkdir lect_nfs
$ chmod 777 lect_nfs
$ sudo vi nfs.sh // /mnt/nfs.sh
#!/bin/bash
SERVIP=10.10.15.71
if ! df | grep lect_nfs > /dev/null ; then
ping -c 1 $SERVIP > /dev/null
if [ $? -eq 0 ] ; then
sudo mount -t nfs $SERVIP:/srv/lect_nfs /mnt/lect_nfs
df | grep lect_nfs
fi
fi
실행시켜주면 df 명령어를 쳤을 때 마운트된 걸 확인할 수 있다
$ source nfs.sh