mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
Remove hard-coded paths to system tools available in $PATH
Since at least a44daf2 both run() and run_interactive() can access all
system tools in _PATH_STDPATH. A system that uses non-standard paths,
e.g. /system/bin and /apps/bin, should update _PATH_STDPATH.
For reference, see issue #69 and PRs #70 and #72.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
9c6e046d93
commit
6f61e8e915
5 files changed
+14
-14
No files matched your search
+3
-3
@@ -231,7 +231,7 @@ static void parse_static(char *line)
|
||||
if (MATCH_CMD(line, "check ", x)) {
|
||||
char *dev = strip_line(x);
|
||||
|
||||
strcpy(cmd, "/sbin/fsck -C -a ");
|
||||
strcpy(cmd, "fsck -C -a ");
|
||||
strlcat(cmd, dev, sizeof(cmd));
|
||||
run_interactive(cmd, "Checking file system %s", dev);
|
||||
|
||||
@@ -253,7 +253,7 @@ static void parse_static(char *line)
|
||||
if (MATCH_CMD(line, "module ", x)) {
|
||||
char *mod = strip_line(x);
|
||||
|
||||
strcpy(cmd, "/sbin/modprobe ");
|
||||
strcpy(cmd, "modprobe ");
|
||||
strlcat(cmd, mod, sizeof(cmd));
|
||||
run_interactive(cmd, "Loading kernel module %s", mod);
|
||||
|
||||
@@ -263,7 +263,7 @@ static void parse_static(char *line)
|
||||
if (MATCH_CMD(line, "mknod ", x)) {
|
||||
char *dev = strip_line(x);
|
||||
|
||||
strcpy(cmd, "/bin/mknod ");
|
||||
strcpy(cmd, "mknod ");
|
||||
strlcat(cmd, dev, sizeof(cmd));
|
||||
run_interactive(cmd, "Creating device node %s", dev);
|
||||
|
||||
|
||||
+4
-4
@@ -130,7 +130,7 @@ static int fsck(int pass)
|
||||
continue;
|
||||
}
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "/sbin/fsck -a %s", fs->fs_spec);
|
||||
snprintf(cmd, sizeof(cmd), "fsck -a %s", fs->fs_spec);
|
||||
run_interactive(cmd, "Checking filesystem %.13s", fs->fs_spec);
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ int main(int argc, char* argv[])
|
||||
* Mount filesystems
|
||||
*/
|
||||
#ifdef REMOUNT_ROOTFS
|
||||
run("/bin/mount -n -o remount,rw /");
|
||||
run("mount -n -o remount,rw /");
|
||||
#endif
|
||||
#ifdef SYSROOT
|
||||
mount(SYSROOT, "/", NULL, MS_MOVE, NULL);
|
||||
@@ -361,10 +361,10 @@ int main(int argc, char* argv[])
|
||||
plugin_run_hooks(HOOK_ROOTFS_UP);
|
||||
|
||||
umask(0);
|
||||
if (run_interactive("/bin/mount -na", "Mounting filesystems"))
|
||||
if (run_interactive("mount -na", "Mounting filesystems"))
|
||||
plugin_run_hooks(HOOK_MOUNT_ERROR);
|
||||
|
||||
run("/sbin/swapon -ea");
|
||||
run("swapon -ea");
|
||||
umask(0022);
|
||||
|
||||
/* Base FS up, enable standard SysV init signals */
|
||||
|
||||
@@ -181,16 +181,16 @@ void do_shutdown(shutop_t op)
|
||||
|
||||
/* Unmount any tmpfs before unmounting swap ... */
|
||||
unmount_tmpfs();
|
||||
run("/sbin/swapoff -e -a");
|
||||
run("swapoff -e -a");
|
||||
|
||||
/* ... unmount remaining regular file systems. */
|
||||
unmount_regular();
|
||||
|
||||
/* We sit on / so we must remount it ro, try all the things! */
|
||||
sync();
|
||||
run("/bin/mount -n -o remount,ro -t dummytype dummydev /");
|
||||
run("/bin/mount -n -o remount,ro dummydev /");
|
||||
run("/bin/mount -n -o remount,ro /");
|
||||
run("mount -n -o remount,ro -t dummytype dummydev /");
|
||||
run("mount -n -o remount,ro dummydev /");
|
||||
run("mount -n -o remount,ro /");
|
||||
|
||||
/* Call mdadm to mark any RAID array(s) as clean before halting. */
|
||||
mdadm_wait();
|
||||
|
||||
Reference in new issue
Block a user