opensuse: 修复禁用了 cloud-init 后,弹出了 jeos-firstboot

This commit is contained in:
bin456789 2025-02-09 01:06:33 +08:00
parent d9e2231a50
commit 7d3d12dd35
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -2699,6 +2699,21 @@ disable_cloud_init() {
done
}
disable_jeos_firstboot() {
os_dir=$1
info "Disable JeOS Firstboot"
# 两种方法都可以
# https://github.com/openSUSE/jeos-firstboot?tab=readme-ov-file#usage
rm -rf $os_dir/var/lib/YaST2/reconfig_system
for name in jeos-firstboot jeos-firstboot-snapshot; do
# 服务不存在时会报错
chroot $os_dir systemctl disable "$name.service" 2>/dev/null || true
done
}
create_network_manager_config() {
source_cfg=$1
os_dir=$2
@ -2953,6 +2968,7 @@ EOF
find_and_mount /boot/efi
disable_cloud_init $os_dir
disable_jeos_firstboot $os_dir
# opensuse leap
if grep opensuse-leap $os_dir/etc/os-release; then