diff mbox

[OpenWrt-Devel] procd: patch to support busybox mkfs.ext2

Message ID CAENjB=LQM5md+-1_9sNoRqg6+sosSOHSw3tjC_C5WZN4fR+DUQ@mail.gmail.com
State Changes Requested
Delegated to: John Crispin
Headers show

Commit Message

Luke McKee July 2, 2016, 8:47 p.m. UTC
Hi guys,

This is a little one. Busybox mkfs.ext2 works and with this setup the
ext4 module can mount /tmp without a journal. See #22666 I tested it.

Also the Makefile for procd doesn't have any dependencies for busybox
CONFIG_BUSYBOX_CONFIG_MKFS_EXT2=y OR e2fsprogs.

See the zram-swap Makefile. Mkfs.ext2 is also installed with e2fsprogs
so this wont break anything for those who install the more bloated
utility.

As we all know there is no need for mounting a journal on volatile
memory, so that's the other justification for this patch. busybox
supports all the commandline arguments given to mkfs.ext2

Also THE PATH WAS WRONG IN THE ORIGINAL PATCH for the error messages :P
Maybe e2fsprogs has to be patched so it installs to /sbin like most
other distros (e.g. gentoo)



  long zramsize;
  pid_t pid;
@@ -107,10 +107,10 @@
  pid = fork();
  if (!pid) {
  execvp(mkfs[0], mkfs);
- ERROR("Can't exec /sbin/mkfs.ext4\n");
+ ERROR("Can't exec /sbin/mkfs.ext2\n");
  exit(-1);
  } else if (pid <= 0) {
- ERROR("Can't exec /sbin/mkfs.ext4\n");
+ ERROR("Can't exec /sbin/mkfs.ext2\n");
  return -1;
  } else {
  waitpid(pid, NULL, 0);
diff mbox

Patch

--- zram.c.orig 2016-07-03 02:55:02.412237548 +0700
+++ zram.c 2016-07-03 02:55:54.691233783 +0700
@@ -82,7 +82,7 @@ 
 int
 mount_zram_on_tmp(void)
 {
- char *mkfs[] = { "/usr/sbin/mkfs.ext4", "-b", "4096", "-F", "-L",
"TEMP", "-m", "0", "/dev/zram0", NULL };
+ char *mkfs[] = { "/sbin/mkfs.ext2", "-b", "4096", "-F", "-L",
"TEMP", "-m", "0", "/dev/zram0", NULL };
  FILE *fp;