登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情~
代码拉取完成,页面将自动刷新
仓库状态说明
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
8
Star
2
Fork
44
src-openEuler
/
lorax
关闭
代码
Issues
2
Pull Requests
4
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
lorax中livemedia-creator无法找到qemu
待办的
#ICYM1T
任务
suichangyin
创建于
2025-09-18 12:12
<!-- #请描述你对使用openEuler相关场景的诉求--> 系统:openEuler 2403 内核:6.6.0-28.0.0.34.oe2403.x86_64 【场景描述】(如下载场景/使用文档场景/安装及迁移场景/其他场景) 使用openEuler制作live cd 【ISSUE描述】 1. 使用livemedia-creator制作live cd时,总是提示qemu必须安装,无法制作成功 2. 问题原因1 livemedia-creator启动脚本和python代码中,代码判断qemu安装匹配错误 ``` # cat /usr/sbin/livemedia-creator |grep -A 1 -B 1 qemu-system if is_install and not opts.no_virt \ and not any(glob.glob("/usr/bin/qemu-system-*")): errors.append("qemu needs to be installed.") # cat /usr/lib/python3.11/site-packages/pylorax/installer.py |grep qemu-system QEMU_CMDS = {"x86_64": "qemu-system-x86_64", "i386": "qemu-system-i386", "arm": "qemu-system-arm", "aarch64": "qemu-system-aarch64", "ppc64le": "qemu-system-ppc64" # rpm -qf /usr/sbin/livemedia-creator lorax-34.1-5.oe2403.x86_64 ``` 3. ks参数不再支持 报错信息 ``` 04:21:11,800 INFO anaconda:anaconda: main: /sbin/anaconda 36.16.5-34.oe2403 04:21:11,801 WARNING anaconda:anaconda: stdout: Kernel boot argument 'ks' detected. Did you want to use 'inst.ks' for the installer instead? 04:21:11,801 WARNING anaconda:anaconda: stdout: All Anaconda kernel boot arguments are now required to use 'inst.' prefix! 04:21:11,801 WARNING anaconda:anaconda: stdout: #012############## Installer errors encountered during boot ###############012'ks' is deprecated and has been removed.#012All usage of Anaconda boot arguments without 'inst.' prefix was removed. Please use inst.ks instead.#012#012############ Installer errors encountered during boot end ############ ``` 问题原因: ``` # cat /usr/lib/python3.11/site-packages/pylorax/installer.py |grep ks=file cmdline_args = "ks=file:/%s" % os.path.basename(ks_paths[0]) ``` 应修改为 inst.ks=file:/%s 4. image-minimizer报错 ``` 06:49:00,313 INFO anaconda:program: File "/mnt/sysimage/bin/image-minimizer", line 73, in add_pattern_rpm 06:49:00,313 INFO anaconda:program: rpms.add(hdr['name'].decode("utf8")) 06:49:00,313 INFO anaconda:program: ^^^^^^^^^^^^^^^^^^ 06:49:00,313 INFO anaconda:program: AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'? ``` 根据代码比对,应该去掉decode ``` def add_pattern_rpm(self, rpms, pattern): if self.ts is None: if self.prefix is None: raise Exception('Must specify installation root for droprpm/keeprpm') self.ts = rpm.TransactionSet(self.prefix) mi = self.ts.dbMatch() mi.pattern('name', rpm.RPMMIRE_GLOB, pattern) not_found = True for hdr in mi: not_found = False rpms.add(hdr['name']) if self.verbose and not_found: print("%s package not found" % pattern) ``` 5. os.ftruncate错误 ``` 2025-09-18 16:07:24,961: Traceback (most recent call last): File "/sbin/livemedia-creator", line 207, in main (result_dir, disk_img) = run_creator(opts) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/creator.py", line 708, in run_creator rc = make_runtime(opts, img_mount.mount_dir, work_dir, calculate_disk_size(opts, ks)/1024.0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/creator.py", line 230, in make_runtime return rb.create_ext4_runtime(joinpaths(work_dir, RUNTIME), size=size, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/treebuilder.py", line 251, in create_ext4_runtime imgutils.mkrootfsimg(self.vars.root, joinpaths(workdir, "LiveOS/rootfs.img"), File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 126, in mkrootfsimg mkext4img(rootdir, outfile, label=label, size=fssize) File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 511, in mkext4img mkfsimage("ext4", rootdir, outfile, size, mountargs=mountargs, File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 479, in mkfsimage with LoopDev(outfile, size) as loopdev: ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 345, in __init__ mksparse(self.filename, size) File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 134, in mksparse os.ftruncate(fobj.fileno(), size) TypeError: 'float' object cannot be interpreted as an integer ``` 参考社区源码修复,强制转换size为int类型 ``` def mksparse(outfile, size): '''use os.ftruncate to create a sparse file of the given size.''' with open(outfile, "w") as fobj: os.ftruncate(fobj.fileno(), int(size)) ```
<!-- #请描述你对使用openEuler相关场景的诉求--> 系统:openEuler 2403 内核:6.6.0-28.0.0.34.oe2403.x86_64 【场景描述】(如下载场景/使用文档场景/安装及迁移场景/其他场景) 使用openEuler制作live cd 【ISSUE描述】 1. 使用livemedia-creator制作live cd时,总是提示qemu必须安装,无法制作成功 2. 问题原因1 livemedia-creator启动脚本和python代码中,代码判断qemu安装匹配错误 ``` # cat /usr/sbin/livemedia-creator |grep -A 1 -B 1 qemu-system if is_install and not opts.no_virt \ and not any(glob.glob("/usr/bin/qemu-system-*")): errors.append("qemu needs to be installed.") # cat /usr/lib/python3.11/site-packages/pylorax/installer.py |grep qemu-system QEMU_CMDS = {"x86_64": "qemu-system-x86_64", "i386": "qemu-system-i386", "arm": "qemu-system-arm", "aarch64": "qemu-system-aarch64", "ppc64le": "qemu-system-ppc64" # rpm -qf /usr/sbin/livemedia-creator lorax-34.1-5.oe2403.x86_64 ``` 3. ks参数不再支持 报错信息 ``` 04:21:11,800 INFO anaconda:anaconda: main: /sbin/anaconda 36.16.5-34.oe2403 04:21:11,801 WARNING anaconda:anaconda: stdout: Kernel boot argument 'ks' detected. Did you want to use 'inst.ks' for the installer instead? 04:21:11,801 WARNING anaconda:anaconda: stdout: All Anaconda kernel boot arguments are now required to use 'inst.' prefix! 04:21:11,801 WARNING anaconda:anaconda: stdout: #012############## Installer errors encountered during boot ###############012'ks' is deprecated and has been removed.#012All usage of Anaconda boot arguments without 'inst.' prefix was removed. Please use inst.ks instead.#012#012############ Installer errors encountered during boot end ############ ``` 问题原因: ``` # cat /usr/lib/python3.11/site-packages/pylorax/installer.py |grep ks=file cmdline_args = "ks=file:/%s" % os.path.basename(ks_paths[0]) ``` 应修改为 inst.ks=file:/%s 4. image-minimizer报错 ``` 06:49:00,313 INFO anaconda:program: File "/mnt/sysimage/bin/image-minimizer", line 73, in add_pattern_rpm 06:49:00,313 INFO anaconda:program: rpms.add(hdr['name'].decode("utf8")) 06:49:00,313 INFO anaconda:program: ^^^^^^^^^^^^^^^^^^ 06:49:00,313 INFO anaconda:program: AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'? ``` 根据代码比对,应该去掉decode ``` def add_pattern_rpm(self, rpms, pattern): if self.ts is None: if self.prefix is None: raise Exception('Must specify installation root for droprpm/keeprpm') self.ts = rpm.TransactionSet(self.prefix) mi = self.ts.dbMatch() mi.pattern('name', rpm.RPMMIRE_GLOB, pattern) not_found = True for hdr in mi: not_found = False rpms.add(hdr['name']) if self.verbose and not_found: print("%s package not found" % pattern) ``` 5. os.ftruncate错误 ``` 2025-09-18 16:07:24,961: Traceback (most recent call last): File "/sbin/livemedia-creator", line 207, in main (result_dir, disk_img) = run_creator(opts) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/creator.py", line 708, in run_creator rc = make_runtime(opts, img_mount.mount_dir, work_dir, calculate_disk_size(opts, ks)/1024.0) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/creator.py", line 230, in make_runtime return rb.create_ext4_runtime(joinpaths(work_dir, RUNTIME), size=size, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/treebuilder.py", line 251, in create_ext4_runtime imgutils.mkrootfsimg(self.vars.root, joinpaths(workdir, "LiveOS/rootfs.img"), File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 126, in mkrootfsimg mkext4img(rootdir, outfile, label=label, size=fssize) File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 511, in mkext4img mkfsimage("ext4", rootdir, outfile, size, mountargs=mountargs, File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 479, in mkfsimage with LoopDev(outfile, size) as loopdev: ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 345, in __init__ mksparse(self.filename, size) File "/usr/lib/python3.11/site-packages/pylorax/imgutils.py", line 134, in mksparse os.ftruncate(fobj.fileno(), size) TypeError: 'float' object cannot be interpreted as an integer ``` 参考社区源码修复,强制转换size为int类型 ``` def mksparse(outfile, size): '''use os.ftruncate to create a sparse file of the given size.''' with open(outfile, "w") as fobj: os.ftruncate(fobj.fileno(), int(size)) ```
评论 (
2
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已拒绝
负责人
未设置
标签
sig/sig-OS-Builder
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(3)
1
https://gitee.com/src-openeuler/lorax.git
git@gitee.com:src-openeuler/lorax.git
src-openeuler
lorax
lorax
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册