[LEDE-DEV] procd: patch to support busybox mkfs.ext2

Arjen de Korte arjen+lede at de-korte.org
Sat Jul 2 14:12:45 PDT 2016


Citeren Luke McKee <hojuruku at gmail.com>:

> 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)

If the only reason to switch to ext2 is to remove the journal, why not  
just add

     -O ^has_journal

to the mount options?

> --- 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);
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev






More information about the Lede-dev mailing list