Cov txheej txheem:

Tsim GNU/Linux Kev faib tawm rau Raspberry Pi Siv Yocto Project: 6 Cov Kauj Ruam
Tsim GNU/Linux Kev faib tawm rau Raspberry Pi Siv Yocto Project: 6 Cov Kauj Ruam

Video: Tsim GNU/Linux Kev faib tawm rau Raspberry Pi Siv Yocto Project: 6 Cov Kauj Ruam

Video: Tsim GNU/Linux Kev faib tawm rau Raspberry Pi Siv Yocto Project: 6 Cov Kauj Ruam
Video: Урок 1. Знакомство и установка GNU/Linux 2024, Hlis ntuj nqeg
Anonim
Image
Image

Raspberry Pi yog tej zaum qhov nrov tshaj plaws tus nqi qis ib lub tshuab computer hauv khw. Nws yog ofter siv rau Internet ntawm Yam thiab lwm cov phiaj xwm kos. Ntau qhov GNU/Linux kev faib khoom muaj kev txhawb nqa zoo rau Raspberry Pi thiab tseem muaj Microsoft Windows rau Raspberry Pi 2.

Yog tias koj xav tsim Internet ntawm Yam (IoT) raws li Raspberry Pi thiab yog tias koj xav ua nws txoj haujlwm nws tau pom zoo kom tsim kom muaj kev faib Linux faib uas haum rau qhov xav tau tiag tiag ntawm koj lub cuab yeej. Txhawm rau khau raj Linux faib rau Raspberry Pi koj xav tau bootloader, Linux ntsiav thiab ntau yam kev thov hauv tus neeg siv chaw.

Ib qho ntawm txoj hauv kev nrov tshaj plaws rau kev tsim cov kev cai kos rau Linux faib yog siv Yocto Project. Yocto yog txoj haujlwm koom tes ntawm Linux lub hauv paus uas siv Openembedded moj khaum thiab bitbake tsim cav. Poky yog qhov txheej txheem siv ntawm Yocto Project nrog rau rau lub hlis tso tawm mus. Nws muab cov ntaub ntawv meta faib ua cov txheej thiab cov zaub mov txawv rau tsim ntau pob thiab cov duab.

Cov ntawv qhia no qhia cov kauj ruam tseeb rau kev tsim cov duab nrog tsawg kawg GNU/Linux faib rau Raspberry Pi, uas suav nrog systemd thiab connman.

Kauj ruam 1: Npaj Npaj

Tau txais qhov Code Code
Tau txais qhov Code Code

Rau qhov kev qhia no koj yuav xav tau:

  • Tus kheej lub computer nrog GNU/Linux faib, piv txwv li Ubuntu, uas koj yuav tsim GNU/Linux faib rau Raspberry Pi.
  • Raspberry Pi
  • microSD lossis SD daim npav nyob ntawm seb koj li Raspberry Pi version
  • HDMI cable thiab saib
  • USB keyboard
  • Fais fab mov

Nruab cov pob khoom xav tau ntawm koj lub khoos phis tawj tus kheej nyob ntawm koj li GNU/Linux kev faib khoom: https://www.yoctoproject.org/docs/2.0/yocto-projec…Notes (los ntawm Yunus EmreI):

  • Koj tsis tuaj yeem ci daim duab yog tias koj lub npe hauv tsev tau muab zais vim nws tsis tso cai cov npe npe ntev
  • Kev tsim kho thawj zaug yuav siv sijhawm ntev heev yog tias koj muaj kev sib txuas qeeb
  • Thaum lub teeb nyem cov duab rau SD daim npav nco ntsoov tias koj xaiv lub ntsiab /dev /sdX, tsis yog /dev /sdXp1 lossis lwm yam kev hloov pauv ntawm sab hauv

Kauj Ruam 2: Tau Txais Qhov Code

Ua cov haujlwm hauv qab no ntawm koj lub computer:

  • Clone Poky siv Git (qhov no kuv tab tom rub tawm Jethro (2.0) ntawm Yocto Project):

    git clone -b jethro git: //git.yoctoproject.org/poky

  • Mus rau directory poky:

    cd pog

  • Clone meta-raspberrypi:

    git clone -b jethro git: //git.yoctoproject.org/meta-raspberrypi

Kauj ruam 3: Kho

Kho
Kho
  • Pib pib tsim ib puag ncig

    qhov chaw oe-init-build-env

  • Ntxiv meta-raspberrypi rau BBLAYERS hauv conf/bblayers.conf, tom qab ntawd nws yuav tsum zoo sib xws (tab sis hauv koj cov ntaub ntawv nrog txoj kev sib txawv) rau:

    BBLAYERS? =

    /home/leon/poky/meta \/home/leon/poky/meta-yocto \/home/leon/poky/meta-yocto-bsp \/home/leon/poky/meta-raspberrypi"

  • Qhib conf/local.conf thiab hloov TSHUAB rau raspberrypi, raspberrypi0, raspberrypi2 lossis raspberrypi3 nyob ntawm koj tus qauv Raspberry Pi, piv txwv li:

    TSHUAB ?? = "raspberrypi2"

  • Ntxiv cov kab hauv qab no rau conf/local.conf los teeb tsa GPU nco hauv megabytes:

    GPU_MEM = "16"

  • Xaiv tau, ntxiv cov kab hauv qab no rau conf/local.conf los hloov System V nrog systemd:

    DISTRO_FEATURES_append = "systemd"

    VIRTUAL-RUNTIME_init_manager = "systemd" DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit" VIRTUAL-RUNTIME_initscripts = ""

  • Xaiv tau, txuas kab hauv qab no rau conf/local.conf kom suav nrog kab hais kom ua tus tswj hwm network connman hauv daim duab:

    IMAGE_INSTALL_append = "connman connman-client"

Kauj Ruam 4: Tsim Duab

Tsim Ib Duab
Tsim Ib Duab
  • Ua raws li cov lus txib hauv qab no los tsim cov duab me me ntawm GNU/Linux faib rau koj li Raspberry Pi:

    bitbake rpi-pib-duab

Thov nco ntsoov tias kev tsim kho yuav siv sijhawm ntev txog ob peb teev nyob ntawm qhov khoos phis tawj ntawm koj lub khoos phis tawj ntiag tug thiab kev nrawm ntawm Internet txuas.

Kauj ruam 5: Nyem SD Card

Thaum tsim ua tiav daim duab yuav nyob ntawm txoj hauv kev hauv qab no hauv koj phau ntawv teev npe: tmp/deploy/images/raspberrypi2/rpi-basic-image-raspberrypi2.rpi-sdimg.

Txuas daim npav microSD rau koj lub khoos phis tawj, hloov X nrog nws tus lej sib xws (uas tuaj yeem pom los ntawm cov lus txib xws li lsblk lossis fdisk -l) thiab ua raws cov lus txib hauv qab no kom nyem cov duab rau nws:

sudo umount /dev /sdX

sudo dd yog = tmp/deploy/dluab/raspberrypi2/core-image-weston-raspberrypi2.rpi-sdimg ntawm =/dev/sdX sync sudo umount/dev/sdX

Xwb, yog tias koj xav tau koj tuaj yeem siv bmaptool hloov chaw dd.

Ceev faj heev thaum ua kom pom daim npav SD thiab xyuas kom koj tau siv tsab ntawv raug rau txoj hauv kev mus rau lub cuab yeej. Ua nws ntawm koj tus kheej txoj kev pheej hmoo thiab nco ntsoov tias qhov ua yuam kev tuaj yeem ua rau tsav tsheb ntawm koj lub khoos phis tawj ntiag tug!

Kauj ruam 6: Khau raj thiab Kuaj

Boot Raspberry Pi thiab ua raws cov theem hauv qab no txhawm rau txheeb xyuas tias daim duab ua haujlwm tau zoo:

  • Nkag mus ua lub hauv paus yam tsis muaj tus password
  • Yog tias connman tau teeb tsa, txheeb xyuas tias nws cov kev pabcuam systemd tau raug thauj khoom:

    systemctl xwm txheej -l connman

Pom zoo: