Cov txheej txheem:

Raspberry Pi 4 Ubuntu USB Boot (Tsis Muaj SD Card): 9 Cov Kauj Ruam
Raspberry Pi 4 Ubuntu USB Boot (Tsis Muaj SD Card): 9 Cov Kauj Ruam

Video: Raspberry Pi 4 Ubuntu USB Boot (Tsis Muaj SD Card): 9 Cov Kauj Ruam

Video: Raspberry Pi 4 Ubuntu USB Boot (Tsis Muaj SD Card): 9 Cov Kauj Ruam
Video: Raspberry Pi 4 Boot from USB 2024, Kaum ib hlis
Anonim
Raspberry Pi 4 Ubuntu USB Boot (Tsis Muaj SD Card)
Raspberry Pi 4 Ubuntu USB Boot (Tsis Muaj SD Card)

Cov lus qhia hauv qab no, thiab yuav coj koj mus rau khau raj Raspberry Pi 4 yam tsis muaj daim npav SD.

Yog tias koj tsis xav ua raws cov kauj ruam, muaj cov duab tsim ua ntej ntawm thawj daim ntawv tshaj tawm. Tsuas yog nyem cov duab no rau USB tsav, thiab koj zoo mus (tsuav koj muaj EEPROM uas txhawb nqa USB booting - theem 3)

Khoom siv

Raspberry Pi 4

USB SSD lossis Flash Drive

Kauj Ruam 1: Rub Ubuntu rau Raspberry Pi Los ntawm Ubuntu Site

Rub tawm Ubuntu duab rau raspberry pi 4 tsim Ubuntu lub vev xaib raug cai.

ubuntu.com/download/raspberry-pi

Kauj ruam 2: Sau Duab rau USB Disk

Nyem qhov duab rau USB tsav. Qhov no tuaj yeem yog USB lo, lossis USB SSD. Kuv yuav pom zoo siv Balena Etcher ntawm Windows thiab MacOS. Yog tias koj tab tom siv Ubuntu, cov kws sau duab ua haujlwm yuav ua haujlwm zoo xwb.

www.balena.io/etcher/

Kauj Ruam 3: Hloov kho Raspberry Pi EEPROM

Rau cov kauj ruam no, muaj ob peb theem qis. Yog tias koj twb tau hloov kho Raspberry Pi EEPROM mus rau "ruaj khov" tso tawm, tom qab ntawd koj tuaj yeem hla cov kauj ruam no.

Ua ntej tshaj, koj yuav tsum sau daim duab RaspberryPiOS (https://www.raspberrypi.org/downloads/raspberry-pi-os/) rau hauv daim npav SD.

Qhov thib ob, khau raj Raspberry Pi, thiab hloov kho/etc/default/rpi-eeprom-hloov tshiab cov ntaub ntawv los ntawm kev ntaus ntawv

sudo nano/etc/default/rpi-eeprom-hloov tshiab

thiab hloov qhov "FIRMWARE_RELEASE_STATUS" nkag los ntawm qhov tseem ceeb rau ruaj khov.

Peb, khiav

sudo rpi-eeprom-hloov tshiab -a

los ntawm lub davhlau ya nyob twg, thiab tso cai hloov kho kom tiav.

Saib https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md kom paub meej ntxiv yog tias koj xav tau

Kauj ruam 4: Hloov kho Raspberry Pi Firmware

Rub tawm cov ntaub ntawv hloov kho tshiab los ntawm raspberry pi github site (https://github.com/raspberrypi/firmware/tree/master/boot).

Luam tag nrho *.dat thiab *.elf cov ntaub ntawv mus rau Ubuntu khau raj muab faib rau ntawm tus tsav USB flashed nrog Ubuntu duab los ntawm kauj ruam 2. (Overwrite cov ntaub ntawv uas tau yav tas los muaj)

Kauj Ruam 5: Decompress Kernel

Raspberry Pi 4 bootloader tsis tuaj yeem nqa cov duab kernel compressed. Koj yuav tsum manually decompress qhov no ua ntej koj thawj khau raj.

Txhawm rau ua qhov no ntawm linux, qhib qhov muab faib khau raj ntawm Ubuntu USB thiab khiav

zcat vmlinuz> vmlinux

los ntawm lub davhlau ya nyob twg.

Koj tuaj yeem ua qhov no ntawm Windows siv 7-zip thiab rho tawm cov ntaub ntawv vmlinuz. Tsuas yog nco ntsoov hloov npe cov ntaub ntawv rho tawm rau vmlinux.

Kauj Ruam 6: Hloov Kho Cov Ntaub Ntawv Config.txt

Cov ntaub ntawv config.txt muaj qhov pib xaiv rau ntau yam RaspberryPi cov laug cam. Hloov kho cov ntaub ntawv rau Raspberry Pi 4. Hloov ntu rau [pi4] nrog cov hauv qab no:

[pi4] max_framebuffers = 2 dtoverlay = vc4-fkms-v3d boot_delay kernel = vmlinux initramfs initrd.img followkernel

Kauj Ruam 7: Tsim Auto-Decompression Script

Thaum hloov kho rau Ubuntu lossis ib ntawm nws ntau pob, apt yuav tsim cov duab tshiab. Cov duab no yuav raug kaw, thiab yuav ua rau Raspberry Pi tsis khau raj tom qab hloov tshiab. Txhawm rau kho qhov no, tsab ntawv yuav tsum tau tsim los decompress cov kernel tshiab cov duab tom qab hloov tshiab.

Tsim ib tsab ntawv hu ua auto_decompress_kernel hauv kev faib ua khau raj. Qhov no tuaj yeem ua tiav nrog feem ntau cov kws kho kab ntawv. Hauv Linux, Kuv yuav pom zoo nano lossis Atom, hauv Windows Kuv xav kom Atom (Nco tseg rau koj Windows cov neeg siv Cov Ntawv Hloov Kho, nco ntsoov tshem "TXT" cov ntawv txuas ntxiv. Yog tias koj tsis ua, qhov no yuav tsis ua haujlwm). Tsab ntawv yuav tsum muaj cov cai hauv qab no:

#!/bin/bash -e

#Set Variables BTPATH =/boot/firmware CKPATH = $ BTPATH/vmlinuz DKPATH = $ BTPATH/vmlinux #Check yog tias yuav tsum tau ua kom tiav. yog [-e $ BTPATH/check.md5]; ces yog md5sum --status --ignore -missing -c $ BTPATH/check.md5; tom qab ntawd ncha -e "\ e [32mFiles tsis tau hloov pauv, Decompression tsis xav tau / e [0m" tawm 0 lwm tus ncha -e "\ e [31mHash ua tsis tiav, ntsiav yuav raug muab yaug / e [0m" fi fi #Backup lub qub decompressed ntsiav mv $ DKPATH $ DKPATH.bak yog [! $? == 0]; tom qab ntawd ncha -e "\ e [31mDECOMPRESSED KERNEL BACKUP FAILED! / e [0m" tawm 1 lwm tus echo -e "\ e [32mDecompressed kernel backup tau ua tiav / e [0m" fi #Decompress lub kernel tshiab ncha "Decompressing kernel:" $ CKPATH "…………..” zcat $ CKPATH> $ DKPATH yog [! $? == 0]; tom qab ntawd ncha -e "\ e [31mKERNEL FAILED TO DECOMPRESS! $ BTPATH/check.md5 yog [! $? == 0]; tom qab ntawd ncha -e "\ e [31mMD5 GENERATION FAILED! / e [0m" lwm echo -e "\ e [32mMD5 tau tsim ua tiav / e [0m" fi #Exit exit 0

Kauj Ruam 8: Tsim Lwm Tsab Ntawv

Txhawm rau tsab ntawv uas peb nyuam qhuav tsim los hu ua txhua lub sijhawm pob tau teeb tsa, peb yuav tsum tsim lwm tsab ntawv.

Tsab ntawv no yuav tsum tau tsim nyob hauv Ubuntu filesystem. Yog tias koj ua qhov teeb tsa no ntawm kab ke linux, koj tuaj yeem ua ntu no ua ntej koj pib khau raj, yog tias koj nyob ntawm Windows lossis MacOS, koj yuav tsum ua qhov no tom qab koj thawj khau raj.

Tsim tsab ntawv no hauv /etc/apt/apt.conf.d/ cov npe, thiab npe nws 999_decompress_rpi_kernel

sudo nano /etc/apt/apt.conf.d/999_decompress_rpi_kernel

Cov cai yuav tsum yog:

DPkg:: Post-Invoke {"/bin/bash/boot/firmware/auto_decompress_kernel"; };

Thaum qhov no tau tsim lawm, koj yuav tsum ua kom tsab ntawv ua tiav. Qhov no tuaj yeem ua tiav siv cov cai hauv qab no:

sudo chmod +x /etc/apt/apt.conf.d/999_decompress_rpi_kernel

Kauj Ruam 9: Txaus siab rau Ubuntu ntawm Raspberry Pi 4

Tam sim no koj tuaj yeem khau raj Ubuntu ntawm USB qhib tsav.

Pom zoo: