Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ int main(int argc, char **argv)
check_and_add_lib("-lpthread", false);
build();
remove_test_dot_c();
printf("\n\nThis program has Super Neko Powers! >w<\n");
return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions doc/USAGE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Undocumented part:
The `load`, `run`, `sfx` and `netns` subcommand is WIP, it should not be used by users.
# $PATH injection:
rurima will automatically add /path/to/rurima/ to the top of $PATH.
So you can just put required binaries like `tar/curl/jq/file` under the same dir of rurima, or do some wrapper script hacking.
# Image source:
rurima currently supports both lxc-mirror and dockerhub as container image source.
# Unified image puller:
Expand Down
13 changes: 10 additions & 3 deletions src/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,15 @@ int rurima_backup_dir(char *_Nonnull file, char *_Nonnull dir)
rurima_fork_rexec(rexec_args);
if (!du_found()) {
rurima_warning("{yellow}du not found, progress will not be shown.\n");
int exstat = tar_backup__(file, dir);
return exstat;
pid_t pid = fork();
if (pid > 0) {
int status;
waitpid(pid, &status, 0);
return WEXITSTATUS(status);
} else {
int exstat = tar_backup__(file, dir);
exit(exstat);
}
}
cprintf("{base}Getting total size to backup\n");
off_t totalsize = rurima_get_dir_file_size(dir);
Expand All @@ -351,7 +358,7 @@ int rurima_backup_dir(char *_Nonnull file, char *_Nonnull dir)
usleep(100);
}
show_progress(1.0);
return status;
return WEXITSTATUS(status);
} else {
int exstat = tar_backup__(file, dir);
exit(exstat);
Expand Down
2 changes: 1 addition & 1 deletion src/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void rurima_show_version_info(void)
cprintf("{base}%s%s\n", "Build date ......................: ", __TIMESTAMP__);
cprintf("{base}\nThere is NO WARRANTY, to the extent permitted by law\n");
cprintf("{base}Docker is a registered trademark of Docker, Inc\nThis program has no relationship with it\n");
cprintf("{base}\nThis program has Super Neko Powers!!!\n");
cprintf("{base}\nThis program has Super Neko Powers! >w<\n");
cprintf("{clear}\n");
}
// For `rurima -V`.
Expand Down
2 changes: 1 addition & 1 deletion src/ruri
Submodule ruri updated from e612c4 to 1e481f
2 changes: 1 addition & 1 deletion src/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ void end_loading_animation(void)
{
if (loading_animation_pid > 0) {
kill(loading_animation_pid, SIGINT);
loading_animation_pid = 0;
}
waitpid(loading_animation_pid, NULL, 0);
fflush(stdout);
loading_animation_pid = 0;
}
void loading_animation(char *msg)
{
Expand Down
7 changes: 4 additions & 3 deletions src/subcommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static void docker_pull_try_mirrors(const char *_Nonnull image, const char *_Non
rexec_argv[0] = NULL;
for (int i = 0; try_mirrorlist[i] != NULL; i++) {
cprintf("{base}Trying mirror: {cyan}%s\n", try_mirrorlist[i]);
rexec_argv[0] = NULL;
rurima_add_argv(&rexec_argv, "docker");
rurima_add_argv(&rexec_argv, "pull");
rurima_add_argv(&rexec_argv, "-i");
Expand Down Expand Up @@ -812,14 +813,14 @@ void rurima_load_rootfs(int argc, char **argv)
char manifest_path[PATH_MAX];
sprintf(manifest_path, "%s/manifest.json", tmp_dir);
FILE *manifest_file = fopen(manifest_path, "r");
if (!manifest_file) {
rurima_error("{red}Failed to open manifest.json!\n");
}
struct stat st;
if (fstat(fileno(manifest_file), &st) != 0) {
rurima_error("{red}Failed to stat manifest.json!\n");
}
char *manifest_content = malloc(st.st_size + 1);
if (!manifest_file) {
rurima_error("{red}Failed to open manifest.json!\n");
}
fread(manifest_content, 1, st.st_size, manifest_file);
manifest_content[st.st_size] = 0;
fclose(manifest_file);
Expand Down
Loading