<div dir="ltr"><a class="gmail_plusreply" id="plusReplyChip-4" href="mailto:yochiang@google.com" tabindex="-1">+Yi-yo Chiang</a> who might have an opinion from the Android side...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 28, 2022 at 5:11 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Toybox mount is autodetecting --bind based on the types of source and dest<br>
(mounting a file on a file or a directory on a directory is a bind mount), but<br>
there's also --rbind which _recursively_ bind mounts. I.E. the bind mounts under<br>
this directory are also bind mounted into the destination.<br>
<br>
I THINK what I want to do is just:<br>
<br>
@@ -184,7 +188,7 @@ static void mount_filesystem(char *dev, char *dir, char *type,<br>
         && ((S_ISREG(stdev.st_mode) && S_ISREG(stdir.st_mode))<br>
             || (S_ISDIR(stdev.st_mode) && S_ISDIR(stdir.st_mode))))<br>
     {<br>
-      flags |= MS_BIND;<br>
+      flags |= MS_BIND|MS_REC;<br>
     } else fp = xfopen("/proc/filesystems", "r");<br>
   } else if (!strcmp(type, "ignore")) return;<br>
   else if (!strcmp(type, "swap"))<br>
<br>
I.E. have the existing bind mount behavior automatically be recursive. But I<br>
wanted to ask for a second opinion here. (I could also implement --rbind and<br>
have it be different than --bind but nobody's come to me with this use case,<br>
it's just me digging through container nonsense coming up with edge cases...)<br>
<br>
Rob<br>
_______________________________________________<br>
Toybox mailing list<br>
<a href="mailto:Toybox@lists.landley.net" target="_blank">Toybox@lists.landley.net</a><br>
<a href="http://lists.landley.net/listinfo.cgi/toybox-landley.net" rel="noreferrer" target="_blank">http://lists.landley.net/listinfo.cgi/toybox-landley.net</a><br>
</blockquote></div>