[Aboriginal] simple-root-filesystem now lives in initramfs (which is actually initmpfs).

David Halls dahalls at gmail.com
Fri Mar 13 13:13:30 PDT 2015


Btw, these are the Toybox patches I'm running with:

diff -ru toybox-0.5.2.orig/lib/portability.c toybox-0.5.2/lib/portability.c
--- toybox-0.5.2.orig/lib/portability.c 2015-02-26 02:42:24.000000000 +0000
+++ toybox-0.5.2/lib/portability.c 2015-03-13 20:07:48.017855796 +0000
@@ -45,7 +45,7 @@
       new_line = realloc(*linep, new_len);
       if (!new_line) return -1;
       *np = new_len;
-      *linep = new_line;
+      line = *linep = new_line;
     }

     line[i] = ch;
@@ -59,7 +59,7 @@
     new_line = realloc(*linep, new_len);
     if (!new_line) return -1;
     *np = new_len;
-    *linep = new_line;
+    line = *linep = new_line;
   }
   line[i + 1] = '\0';

diff -ru toybox-0.5.2.orig/toys/posix/cp.c toybox-0.5.2/toys/posix/cp.c
--- toybox-0.5.2.orig/toys/posix/cp.c 2015-02-26 02:42:24.000000000 +0000
+++ toybox-0.5.2/toys/posix/cp.c 2015-03-13 20:08:18.990360352 +0000
@@ -391,6 +391,7 @@
   }

   if (toys.optflags & FLAG_D) {
+    TT.destname = toys.optargs[toys.optc-1];
     if (mkpathat(AT_FDCWD, TT.destname, 0, 2))
       perror_exit("-D '%s'", TT.destname);
     if (toys.optc == 1) return;
diff -ru toybox-0.5.2.orig/toys/posix/find.c toybox-0.5.2/toys/posix/find.c
--- toybox-0.5.2.orig/toys/posix/find.c 2015-02-26 02:42:24.000000000 +0000
+++ toybox-0.5.2/toys/posix/find.c 2015-03-13 20:07:20.927409060 +0000
@@ -435,7 +435,7 @@
           if (aa->dir && TT.topdir == -1) TT.topdir = xopen(".", 0);

         // collect names and execute commands
-        } else if (check) {
+        } else {
           char *name, *ss1 = ss[1];
           struct double_list **ddl;

@@ -443,6 +443,7 @@
           aa = (void *)llist_pop(&argdata);
           ss += aa->arglen + 1;

+          if (check) {
           // name is always a new malloc, so we can always free it.
           name = aa->dir ? xstrdup(new->name) : dirtree_path(new, 0);

@@ -479,6 +480,7 @@
           dlist_add(ddl, name);
           aa->namecount++;
           if (!aa->plus) test = flush_exec(new, aa);
+          }
         }

         // Argument consumed, skip the check.
diff -ru toybox-0.5.2.orig/toys/posix/grep.c toybox-0.5.2/toys/posix/grep.c
--- toybox-0.5.2.orig/toys/posix/grep.c 2015-02-26 02:42:24.000000000 +0000
+++ toybox-0.5.2/toys/posix/grep.c 2015-03-13 20:07:48.017855796 +0000
@@ -75,6 +75,17 @@
     return;
   }

+  struct stat stat;
+  if (fstat(fd, &stat) != 0) {
+    perror_msg("%s", name);
+    fclose(file);
+    return;
+  }
+  if (S_ISDIR(stat.st_mode)) {
+    fclose(file);
+    return;
+  }
+
   for (;;) {
     char *line = 0, *start;
     regmatch_t matches[3];


On 13 March 2015 at 06:32, David Halls <dahalls at gmail.com> wrote:

> I note that if you're building a nontrivial amount of stuff,
>> chroot-setup is probably your friend. Otherwise you'll install stuff
>> into / until you fill it up, it's generally only got 100 megs or so of
>> space. (Half of physical memory.)
>>
>
> I'm installing everything I build into /home/install, don't touch the
> rest. Then /home/install itself becomes a sqf so it can't be messed with
> either.
>
>
>>
>> I still have a todo item from you (grep segfault with uClibc). I should
>> go fix that now. (I had enough work getting the move to initramfs
>> working I just shipped it once it built LFS on the targets. I'm still a
>> kernel version behind, it's still running uclibc instead of musl...)
>>
>
> No worries, I automate the patching anyway.
> Aboriginal is good enough for me as it is, although uclibc could probably
> to with some love/replacement.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/aboriginal-landley.net/attachments/20150313/7664c6d6/attachment-0002.htm>


More information about the Aboriginal mailing list