Linux arm 支持 ntfs 文件系统

1.下载 ntfs-3g 开源代码
2.交叉编译
如果没有其他地方需要用到这个动态库,可以考虑禁止编译动态库,只生成动态库,这样生成的课执行文件可以直接在arm板运行,不用设置动态链接
–disable-shared:禁止生成动态库
–enable-static:使能静态库

tar zxf ntfs-3g_ntfsprogs-2017.3.23.tgz  
cd ntfs-3g_ntfsprogs-2017.3.23/
./configure CC=arm-hisiv300-linux-gcc --prefix=$PWD/result --exec-prefix=$PWD/result --host=arm-hisiv300-linux --disable-shared --enable-static
make

make 执行完成后,在src目录下有生成一个 ntfs-3g 的可执行文件,大小1.5M,strip之后365k。
在这里插入图片描述
ntfs-3g 复制到arm板,可以直接执行,如果配置时没有加 --disable-shared,会需要指定动态库路径才可以运行。
在这里插入图片描述
在这里插入图片描述
到这一步,得到了可执行文件且可以正常在目标arm板运行,不需要再 make install,我这里的编译环境,执行 make install 一直无法完全执行成功,下面记录一下错误信息

3.安装

make install

...
make[3]: Entering directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/ntfsprogs'
/usr/bin/install -c -d /sbin
ln -s -f /home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result/sbin/mkntfs /sbin/mkfs.ntfs
ln: cannot remove ‘/sbin/mkfs.ntfs’: Permission denied
make[3]: *** [install-exec-hook] Error 1
make[3]: Leaving directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/ntfsprogs'
make[2]: *** [install-exec-am] Error 2
make[2]: Leaving directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/ntfsprogs'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/ntfsprogs'
make: *** [install-recursive] Error 1

make install 时会报错,主要是 Makefile 里面的 DESTDIR 没给定义,configure也没有给出怎样定义。
于是,在make install 时指定了 DESTDIR,仍然会报错,但在 result/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result 目录下基本生成了需要的文件。
原因有可能是执行configure没配置好,也有可能是这个configure没考虑到不安装在当前系统的情况,这里不再深究了。得到交叉编译后的可执行文件就可以了。
注意一点,别使用 root 用户或者 sudo 去执行 make install,这样可能会覆盖掉pc里的某些库或者执行文件。

make install DESTDIR=$PWD/result

...
/bin/mkdir -p "/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result/sbin"
ln -s -f "/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result/bin/ntfs-3g" "/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result/sbin/mount.ntfs-3g"
ln -s -f "/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result/bin/lowntfs-3g" "/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/result/sbin/mount.lowntfs-3g"
make  install-exec-hook
make[3]: Entering directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/src'
/sbin/ldconfig
/sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
make[3]: *** [install-exec-hook] Error 1
make[3]: Leaving directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/src'
make[2]: *** [install-exec-am] Error 2
make[2]: Leaving directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/src'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/samba/00_ntfs-3g/ntfs-3g_ntfsprogs-2017.3.23/src'
make: *** [install-recursive] Error 1

4.其他下载路径
NTFS-3G Safe Read/Write NTFS Driver

使用这个的话,里面没有 configure 文件,需要先执行 autogen.sh,没有auto环境则需要先安装

sudo apt install autoconf automake libtool -y
sudo apt install libgcrypt-dev -y
./autogen.sh
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
全志R16平台编译linux系统V1.0.txt 2017/4/11 13:36 (编译请使用编译android的lichee的选项编译生成的.config文件,不然直接编译会报错!!!!) rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ tar zxvf lichee_parrotv1.1_20161202.tar.gz rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ cd lichee/ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux 3. tina Choice: 2 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. bell-one 1. evb 2. evb-20 3. evb-30 4. evb-rtl8723bs 5. sc3813r Choice: 3 rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh 错误1: KCONFIG_AUTOCONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf --silentoldconfig Config.in # # make dependencies written to .auto.deps # ATTENTION buildroot devels! # See top of this file before playing with this auto-preprequisites! # make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/buildroot' You must install 'makeinfo' on your build machine makeinfo is usually part of the texinfo package in your distribution make: *** [dependencies] 错误 1 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ d/buildroot-config/conf.o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/zconf.tab.o -o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buil
Linux平台上生成ARM SD卡文件,需要经过以下步骤: 1. 准备软件工具和材料:需要一个可以读写SD卡的读卡器,一张空白的SD卡,以及用于制作SD卡镜像的工具,例如dd命令和mkfs工具。 2. 插入SD卡并确认设备路径:将SD卡插入读卡器后,可以使用lsblk命令查看SD卡所对应的设备路径,例如/dev/sdb。 3. 创建SD卡分区:使用fdisk或parted命令对SD卡进行分区操作。可以选择创建一个主分区或多个分区,具体根据需求而定。在分区操作完成后,会得到一个或多个设备路径,例如/dev/sdb1。 4. 格式化SD卡分区:使用mkfs命令对SD卡分区进行格式化,例如mkfs.ext4 /dev/sdb1。这将在分区上创建一个ext4文件系统,也可以根据需要选择其他文件系统。 5. 挂载SD卡分区:创建一个空文件夹作为挂载点,例如/mnt/sdcard,然后使用mount命令将SD卡分区挂载到该目录下,例如mount /dev/sdb1 /mnt/sdcard。 6. 复制文件到SD卡:将需要拷贝到SD卡的文件或目录复制到已挂载的SD卡分区中,例如cp -r /path/to/files/* /mnt/sdcard/。 7. 卸载SD卡:在完成文件拷贝之后,使用umount命令将SD卡分区卸载,例如umount /mnt/sdcard。 8. 通过dd命令生成SD卡镜像文件:使用dd命令可以将整个SD卡复制为一个镜像文件,例如dd if=/dev/sdb of=/path/to/image.img bs=4M。其中,if参数指定输入设备(SD卡),of参数指定输出文件(镜像文件),bs参数指定复制的块大小。 以上是在Linux上生成ARM SD卡文件的基本步骤,具体操作中需要注意设备路径、格式化和拷贝文件的命令,以及对SD卡进行操作时的权限管理。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wkd_007

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值