openwrt
- OpenWrt鏡像:https://archive.openwrt.org/releases/22.03.2/targets/bcm27xx/bcm2711/openwrt-22.03.2-bcm27xx-bcm2711-rpi-4-ext4-factory.img.gz
- OpenWrt工具鏈:https://archive.openwrt.org/releases/22.03.2/targets/bcm27xx/bcm2711/openwrt-toolchain-22.03.2-bcm27xx-bcm2711_gcc-11.2.0_musl.Linux-x86_64.tar.xz
- 版本:22.03.2
安裝
At the PC:
#unzip the Image
gzip -d openwrt-21.02.0-bcm27xx-bcm2708-rpi-squashfs-factory.img.gz
# insert SD-card and check the name, alternatively check dmesg
lsblk
# copy the Image 1:1 to the SD-card
sudo dd if=openwrt-21.02.0-bcm27xx-bcm2708-rpi-squashfs-factory.img of=/dev/mmcblk0 bs=1M conv=fsync
擴展文件系統
SSH INTO THE RASPBERRY PI:
opkg install kmod-usb-storage kmod-usb-ohci kmod-usb-uhci e2fsprogs fdisk resize2fs
fdisk /dev/mmcblk0
(also see the less finicky way by @SemperEnim below):
To make it clear what I entered, here the complete session of fdisk. Please note how the first sector remains unaltered:
Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/mmcblk0: 14.99 GiB, 16096690176 bytes, 31438848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 8192 139263 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 147456 360447 212992 104M 83 Linux
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2048-31438847, default 2048): 147456
Last sector, +/-sectors or +/-size{K,M,G,T,P} (147456-31438847, default 31438847):
Created a new partition 2 of type 'Linux' and of size 14.9 GiB.
Partition #2 contains a squashfs signature.
Do you want to remove the signature? [Y]es/[N]o: n
Command (m for help): p
Disk /dev/mmcblk0: 14.99 GiB, 16096690176 bytes, 31438848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5452574f
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 8192 139263 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 147456 31438847 31291392 14.9G 83 Linux
Command (m for help): w
The partition table has been altered.
Syncing disks.
REBOOT AND LOG IN AGAIN
The device usage and sizes are now as follows (my SD-card is 16 GB in size). The size needs still needs to be adjusted:
df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 4.3M 4.3M 0 100% /rom
tmpfs 217.9M 52.0K 217.9M 0% /tmp
/dev/loop0 92.7M 2.6M 83.1M 3% /overlay
overlayfs:/overlay 92.7M 2.6M 83.1M 3% /
/dev/mmcblk0p1 63.9M 17.3M 46.6M 27% /boot
tmpfs 512.0K 0 512.0K 0% /dev
Actually this was easier than expected, simply use resize2fs:
opkg update && opkg install resize2fs
resize2fs /dev/loop0
resize2fs 1.45.6 (20-Mar-2020)
Filesystem at /dev/loop0 is mounted on /overlay; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 120
The filesystem on /dev/loop0 is now 15641408 (1k) blocks long.
AND NOW DF -H RETURNS THE ADJUSTED SIZE:
df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 4.3M 4.3M 0 100% /rom
tmpfs 217.9M 56.0K 217.9M 0% /tmp
/dev/loop0 14.5G 3.1M 13.9G 0% /overlay
overlayfs:/overlay 14.5G 3.1M 13.9G 0% /
/dev/mmcblk0p1 63.9M 17.3M 46.6M 27% /boot
tmpfs 512.0K 0 512.0K 0% /dev
WX:上海晶珩電子
審核編輯黃宇
聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。
舉報投訴
-
OpenWrt
+關注
關注
10文章
122瀏覽量
39151 -
樹莓派
+關注
關注
116文章
1679瀏覽量
105260
發布評論請先 登錄
相關推薦
樹莓派的種類_樹莓派安裝教程
樹莓派(Raspberry Pi)是尺寸僅有信用卡大小的一個小型電腦,您可以將樹莓派連接電視、顯示器、鍵盤鼠標等設備使用。目前,樹莓
發表于 11-27 22:01
?5285次閱讀
樹莓派3硬件配置_樹莓派3都能裝什么系統_樹莓派3系統安裝教程
樹莓派3一直頗受電子發燒友的青睞,這篇文章主要討論的就是樹莓派3的硬件配置、樹莓派3都能裝什么系
發表于 12-08 14:36
?2.6w次閱讀
樹莓派3系統安裝介紹_Noobs進行樹莓派3系統安裝_Noobs進行樹莓派3系統恢復
這篇文章主要和大家一起來討論一下關于樹莓派3的系統安裝是什么,基于Noobs的樹莓派3的系統安裝
發表于 12-08 15:02
?5883次閱讀
使用樹莓派設計智能小車教程之如何進行樹莓派模塊安裝資料免費下載
本文檔的主要內容詳細介紹的是使用樹莓派設計智能小車教程之如何進行樹莓派模塊安裝資料免費下載。
發表于 06-24 08:00
?21次下載
【樹莓派】樹莓派4B新手篇:安裝官網Raspbian Buster系統及基礎配置
目錄1、前言2、樹莓派4B有什么特色?3、樹莓派新手準備4、燒錄Raspbian Buster系
發表于 11-06 18:21
?26次下載
評論