ubuntu 20.04 buildroot编译错误以及修正方法
1 编译buildroot错误
buildroot$ make -j4
>>> linux-headers custom Extracting
gzip -d -c /media/8058434CE2FCC885/zcu102/buildroot/dl/linux/xlnx_rebase_v5.15_LTS_2022.2.tar.gz | tar --strip-components=1 -C /media/8058434CE2FCC885/zcu102/buildroot/output/build/linux-headers-custom -xf -
tar: drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c: Cannot open: Invalid argument
tar: drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h: Cannot open: Invalid argument
tar: include/soc/arc/aux.h: Cannot open: Invalid argument
tar: Exiting with failure status due to previous errors
make[1]: *** [package/pkg-generic.mk:217: /media/8058434CE2FCC885/zcu102/buildroot/output/build/linux-headers-custom/.stamp_extracted] Error 2
make: *** [Makefile:82: _all] Error 2
该问题主要是由于tar: drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c: Cannot open: Invalid argument
错误导致编译失败,是因为当前的磁盘的格式是非ubuntu的格式,当前磁盘的格式为ntfs导致的,需要将当前的磁盘修改为ext4格式的。
2 将磁盘文件系统格式从ntfs修改为ext4格式
2.1 df -l
rlk@PC-4CE1291N:/media/rlk/8058434CE2FCC885/ssdk$ df -l
Filesystem 1K-blocks Used Available Use% Mounted on
udev 16317404 0 16317404 0% /dev
tmpfs 3271184 1924 3269260 1% /run
/dev/nvme0n1p2 244506940 38754740 193259144 17% /
tmpfs 16355908 164240 16191668 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 16355908 0 16355908 0% /sys/fs/cgroup
/dev/loop0 128 128 0 100% /snap/bare/5
/dev/loop3 55552 55552 0 100% /snap/snap-store/558
/dev/loop2 66816 66816 0 100% /snap/gtk-common-themes/1519
/dev/loop1 254848 254848 0 100% /snap/gnome-3-38-2004/99
/dev/loop5 63488 63488 0 100% /snap/core20/1328
/dev/loop4 44672 44672 0 100% /snap/snapd/14978
/dev/nvme0n1p1 523248 6196 517052 2% /boot/efi
tmpfs 3271180 88 3271092 1% /run/user/1000
/dev/sda3 485505092 92759768 392745324 20% /media/rlk/0F2F2D3A61075EBB
/dev/sda1 734004220 96597840 637406380 14% /media/rlk/8058434CE2FCC885
/dev/sda2 721338488 20719284 663902664 4% /media/rlk/sda2
rlk@PC-4CE1291N:/media/rlk/8058434CE2FCC885/ssdk$
2.2 umount /media/rlk/0F2F2D3A61075EBB
将/media/rlk/0F2F2D3A61075EBB的挂载点卸载
umount /media/rlk/0F2F2D3A61075EBB
2.3 创建新的挂载点/media/rlk/sda3
重新创建一个新的挂载点
sudo mkdir /media/rlk/sda3
sudo chmod 777 /media/rlk/sda3 -R
2.4 格式化/dev/sda3
把/dev/sda3格式化为ext4
:~$ sudo mkfs.ext4 /dev/sda3
[sudo] password for rlk:
mke2fs 1.45.5 (07-Jan-2020)
/dev/sda3 contains a ntfs file system
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 121376273 4k blocks and 30351360 inodes
Filesystem UUID: 570739ea-eeed-480c-b3ec-653a43f28df4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks):
done
Writing superblocks and filesystem accounting information: done
rlk@PC-4CE1291N:~$
2.5 重新将/dev/sda3挂载到/media/rlk/sda3上
sudo mount /dev/sda3 /media/rlk/sda3
2.6 sudo blkid
执行sudo blkid可以查看到/dev/sda3的节点信息,其UUID为:/dev/sda3: UUID="570739ea-eeed-480c-b3ec-653a43f28df4"
sudo blkid
[sudo] password for rlk:
/dev/nvme0n1p2: UUID="ae7659ad-de68-4cef-9fc4-8bc8f6d9c7e7" TYPE="ext4" PARTUUID="170ced09-e314-4349-98a6-8c23802485a8"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/nvme0n1p1: UUID="1442-1301" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="4553bcb5-f604-4a73-8750-3207306aaed3"
/dev/sda1: UUID="8058434CE2FCC885" TYPE="ntfs" PTTYPE="atari" PARTLABEL="Basic data partition" PARTUUID="07793115-4300-49a9-920c-25f7d0274dbf"
/dev/sda2: UUID="e52064a9-fd83-4d9e-8510-c32c77bdf055" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="3d495a4b-86ea-41e0-a686-5336f3acd248"
/dev/sda3: UUID="570739ea-eeed-480c-b3ec-653a43f28df4" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="668cfcc1-bda3-43ad-b737-6d6ece891b25"
2.7 设置自动挂载/dev/sda3磁盘节点
sudo vim /etc/fstab
打开/etc/fstab,将下面的一行配置添加到/etc/fstab中,则每次启动都会去自动挂载/dev/sda3磁盘节点。
UUID=570739ea-eeed-480c-b3ec-653a43f28df4 /media/rlk/sda3 ext4 defaults 1 2