Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when bin/genimage is not placed in current working directory #3

Closed
CamberLoid opened this issue May 23, 2022 · 3 comments
Closed

Comments

@CamberLoid
Copy link

当目前的工作目录下不存在 bin/genimage 时,OpenixCard 进行 dump 操作时将会出现问题并退出。

[[maybe_unused]] Genimage::Genimage(std::string config_path, std::string image_path, std::string output_path)
: config_path(std::move(config_path)), image_path(std::move(image_path)), output_path(std::move(output_path)) {
this->genimage_bin = std::filesystem::current_path() / "bin/genimage";
// generate blank.fex file for commented partition
generate_blank_fex();
// call genimage
run_genimage();
}

# camber @ Camber-Arch in /mnt/AOSC [10:33:27] C:130
$ OpenixCard -i 20211230_LicheeRV_debian_d1_hdmi_8723ds.img -d
 _____             _     _____           _ 
|     |___ ___ ___|_|_ _|     |___ ___ _| |
|  |  | . | -_|   | |_'_|   --| .'|  _| . |
|_____|  _|___|_|_|_|_,_|_____|__,|_| |___|
      |_| Version: 4a1514b
Copyright (c) 2022, YuzukiTsuru <GloomyGhost@GloomyGhost.com>

[OpenixCard INFO] Input file: 20211230_LicheeRV_debian_d1_hdmi_8723ds.img Now converting...
[OpenixCard INFO] Convert Done! Prasing the partition tables...
[OpenixCard INFO] Prase Done! Generating target image...
terminate called after throwing an instance of 'subprocess::CalledProcessError'
  what():  execve failed : No such file or directory
[1]    122586 IOT instruction (core dumped)  OpenixCard -i 20211230_LicheeRV_debian_d1_hdmi_8723ds.img -d

当前,OpenixCard 仅会在当前目录下搜索 bin/genimage 可执行文件。这样的设计不便于将可执行文件放置在其他 PATH 目录下的用户使用,亦不便于发行版打包者对 OpenixCard 进行打包,将该项目使用包管理器管理。

一个理想的行为是在 PATH 环境变量所定义的目录下逐一搜索 genimage 并调用第一个找到的合法的可执行的 genimage 文件,亦可以允许用户手动指定 genimage 程序的位置。

@YuzukiTsuru
Copy link
Owner

不需要,下一个版本会集成genimage

@CamberLoid
Copy link
Author

已知悉。感谢回复。

@CamberLoid
Copy link
Author

FYI the package is now available on Archlinux User Repository (with workaround)

https://aur.archlinux.org/packages/openixcard

CamberLoid added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue May 24, 2022
Including a patch as a workaround to fix issue YuzukiTsuru/OpenixCard#3
Reference: YuzukiTsuru/OpenixCard#3
CamberLoid added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue May 31, 2022
Including a patch as a workaround to fix issue YuzukiTsuru/OpenixCard#3
Reference: YuzukiTsuru/OpenixCard#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants