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

Luke McKee hojuruku at gmail.com
Sat Jul 2 16:47:15 EDT 2016


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)



--- 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;
  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);
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list