惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
月光博客
月光博客
人人都是产品经理
人人都是产品经理
美团技术团队
J
Java Code Geeks
博客园 - 聂微东
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
罗磊的独立博客
博客园 - 【当耐特】
GbyAI
GbyAI
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
D
Docker
Vercel News
Vercel News
小众软件
小众软件
NISL@THU
NISL@THU
Simon Willison's Weblog
Simon Willison's Weblog
雷峰网
雷峰网
Spread Privacy
Spread Privacy
T
Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
爱范儿
爱范儿
L
LINUX DO - 热门话题
博客园_首页
I
Intezer
博客园 - Franky
Security Latest
Security Latest
Scott Helme
Scott Helme
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Schneier on Security
O
OpenAI News
WordPress大学
WordPress大学
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
G
Google Developers Blog
M
MIT News - Artificial intelligence
The Register - Security
The Register - Security
Cisco Talos Blog
Cisco Talos Blog
Forbes - Security
Forbes - Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
SecWiki News
SecWiki News
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News | PayPal Newsroom
量子位
博客园 - 三生石上(FineUI控件)

博客园 - midhillzhou

windows 11关闭防火墙 以使得 外部的开发板可以主动发起ping通电脑 uboot中调试景略以太网phy JL3111A2-NA windows上excel运行macro之后出现错误 在linux上移植phytool + 调试tja1103 以太网phy 使用gdb调试user程序 之 某个线程的调用栈 在uboot中修改tja 1103以太网phy from slave to master porting perf性能观测工具 porting 开源memtester uboot 2020版本下gpio命令的使用 + linux下的libgpiod lib库的移植使用 ubi文件系统的 制作 + 挂载 + 若干问题 i2c指令使用 + 仿照开源i2ctransfer实现的自己的i2ctransfer windows下outlook 撤回邮件 安装repo 使用lauterbach debug uboot之重定位 uboot中各种memory读写命令 uboot nand flash dump 环境变量 + 制作环境变量分区 + 代码结构详解 uboot bootm代码详解图 Beyond Compare 进行二进制文档的比对时,怎么去对齐(转载) notepad++分析log小技巧 使用继电器控制开发板上下电 uboot debug小技巧
在linux上移植sgdisk
midhillzhou · 2026-01-28 · via 博客园 - midhillzhou

 1.下载代码

git clone https://git.code.sf.net/p/gptfdisk/code gptfdisk

2.编译指令

make sgdisk 
CC=aarch64-none-linux-gnu-gcc 
CXX=aarch64-none-linux-gnu-g++ 
CFLAGS="--sysroot=rootfs_sdk/aarch64-buildroot-linux-gnu/sysroot" 
CXXFLAGS="--sysroot=rootfs_sdk/aarch64-buildroot-linux-gnu/sysroot" 
LDFLAGS="--sysroot=rootfs_sdk/aarch64-buildroot-linux-gnu/sysroot -Lrootfs_sdk/aarch64-buildroot-linux-gnu/sysroot/usr/lib"

将上式中的rootfs_sdk替换成sdk编译出来的sysroot的绝对路径,比如/home/zhongshan/SDK_V1.1/build/out/demo_emmc/objs/buildroot/rootfs_sdk

并将这些合成一行输入,

注意-Lrootfs_sdk里面的rootfs_sdk也要替换掉。比如-L/home/zhongshan/SDK_V1.1/build/out/demo_emmc/objs/buildroot/rootfs_sdk

3.将编译生成的sgdisk复制到板子上,并执行如下命令,查看分区情况

scp ./sgdisk root@192.168.1.202:/tmp/
root@mxx:/tmp # ./sgdisk -p /dev/mmcblk0
Disk /dev/mmcblk0: 61079552 sectors, 29.1 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 493DDFCA-B275-4783-B265-21CD15E365D0
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 61079518
Partitions will be aligned on 32-sector boundaries
Total free space is 58055037 sectors (27.7 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            2303   128.0 KiB   0700  sbl_a
   2            2304            2559   128.0 KiB   0700  sbl_b
   3            2560            2815   128.0 KiB   0700  hsm_a
   4            2816            3071   128.0 KiB   0700  hsm_b
   5            3072            3327   128.0 KiB   0700  metadata
   6            3328            3583   128.0 KiB   0700  metadata_bak
   7            3584            4607   512.0 KiB   0700  spl_a
   8            4608            5631   512.0 KiB   0700  spl_b
   9            5632            9727   2.0 MiB     0700  rtos_a
  10            9728           13823   2.0 MiB     0700  rtos_b
  11           13824           14847   512.0 KiB   0700  appdata
  12           14848           14879   16.0 KiB    0700  misc
  13           14880           14911   16.0 KiB    0700  misc_bak
  14           14912           15167   128.0 KiB   0700  ubootenv
  15           15168           15423   128.0 KiB   0700  ubootenv_bak
  16           15424           19519   2.0 MiB     0700  uboot_a
  17           19520           23615   2.0 MiB     0700  uboot_b
  18           23616           23871   128.0 KiB   0700  atf_a
  19           23872           24127   128.0 KiB   0700  atf_b
  20           24128           26175   1024.0 KiB  0700  optee_a
  21           26176           28223   1024.0 KiB  0700  optee_b
  22           28224           69183   20.0 MiB    0700  kernel_a
  23           69184          110143   20.0 MiB    0700  kernel_b
  24          110144          519743   200.0 MiB   0700  rootfs_a
  25          519744          929343   200.0 MiB   0700  rootfs_b
  26          929344         3026495   1024.0 MiB  0700  userdata

注释1:一个关于emmc 分区spec的网站

 https://uefi.org/specs/UEFI/2.10/05_GUID_Partition_Table_Format.html#

注释2:后来同事发现还有一个展示信息更加丰富的工具,如下

image