背景:在实际使用中,默认的镜像开启了很多无用的服务,如docker,想要实现批量烧写并关闭此服务,可以参考一下方法。 操作方法: diff --git a/tools/flex-builder b/tools/flex-builder index 7f29eb6d..b7a619a3 100755 --- a/tools/flex-builder +++ b/tools/flex-builder @@ -836,6 +836,11 @@ build_distro_rfs_ubuntu() { sudo chroot $RFSDIR systemctl enable aging_test.service sudo chroot $RFSDIR mv /lib/systemd/system/aging_test.service /lib/systemd/system/aging_test.service.bak sudo chroot $RFSDIR systemctl enable /etc/systemd/system/forlinx.service + sudo chroot $RFSDIR systemctl disabled docker.service + sudo chroot $RFSDIR systemctl disabled docker.socket #sudo chroot $RFSDIR systemctl disable wpa_supplicant.service #sudo chroot $RFSDIR systemctl unmask hostapd #sudo chroot $RFSDIR systemctl disable hostapd.service 以上及为修改方法,基本原理为,在系统打包时,会将文件系统使用chroot命令设置为根目录,之后会自动执行systemctl disabled docker.service等命令,关闭服务,之后在打包生成ubuntu.img,之后再去烧写ubuntu.img就可以默认关闭这个服务了。 |
|小黑屋|
飞凌嵌入式
( 冀ICP备12004394号-1 )
GMT+8, 2025-7-12 03:25
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.