拓冰建站拓冰建站
首页 / 资讯中心 / 正文

linux app的U盘升级

升级程序其实主要就是通过脚本去执行了升级操作int common_dir_update(const char *dir, int showmsg) { char buf[256]; int ret; int need_reboot = 0; int timeout = 30; snprintf(buf, sizeof(buf), "%s/extra_cmd.txt", dir); if(access(buf, F_OK) == 0) { if(handle_extra_cmd(buf, timeout)) need_reboot = 1; } snprintf(buf, sizeof(buf), "%s/posupdate.sh", dir); if(access(buf, F_OK) == 0) { if(showmsg) uicont_set_showMsg(-1, "开始升级\n"); chmod(buf, 0777); snprintf(buf, sizeof(buf), "%s/posupdate.sh %s", dir, dir); ret = system_server_execute(buf, timeout); if(WIFEXITED(ret)) { if(WEXITSTATUS(ret) == 1) need_reboot = 1; } if(showmsg) { if(need_reboot) uicont_set_showMsg(0, "结束升级,需要重启\n"); else uicont_set_showMsg(
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门