IIRC that all lost and founds get labeled properly if you have a valid
file_context for them (see below). Typically the issue is the one on
/data or /cache when your doing an upgrade and not formatting /data or
/cache (which means no mkdir and no label). A restorecon will suffice
in the initscript.

system/extras/ext4_utils$ vim make_ext4fs.c
        if (needs_lost_and_found) {
                /* insert a lost+found directory at the beginning of
the dentries */
                struct dentry *tmp = calloc(entries + 1, sizeof(struct dentry));
                memset(tmp, 0, sizeof(struct dentry));
                memcpy(tmp + 1, dentries, entries * sizeof(struct dentry));
                dentries = tmp;

                dentries[0].filename = strdup("lost+found");
                asprintf(&dentries[0].path, "%slost+found", dir_path);
                dentries[0].full_path = NULL;
                dentries[0].size = 0;
                dentries[0].mode = S_IRWXU;
                dentries[0].file_type = EXT4_FT_DIR;
                dentries[0].uid = 0;
                dentries[0].gid = 0;
                if (sehnd) {
                        if (selabel_lookup(sehnd, &dentries[0].secon,
dentries[0].path, dentries[0].mode) < 0)
                                error("cannot lookup security context
for %s", dentries[0].path);
                }
                entries++;
                dirs++;
        }

        inode = make_directory(dir_inode, entries, dentries, dirs);


system/core/rootdir/init.rc:
  # create the lost+found directories, so as to enforce our permissions
    mkdir /cache/lost+found 0770 root root

    # create the lost+found directories, so as to enforce our permissions
    mkdir /data/lost+found 0770 root root


On Wed, Feb 5, 2014 at 7:50 AM, Tai Nguyen (tainguye)
<[email protected]> wrote:
> make_ext4fs creates a default lost+found directory without label. The option
> -S and -a sets the label for the root directory only.
> And option -L doesn't seem to work for me. I looked at the code and didn't
> see it is used anywhere except the print statement.
>
> So, what is the recommended/common way to set the label for lost+found dir
> in ext4 fs?
>
> Thanks,
> Tai
>
>
> _______________________________________________
> Seandroid-list mailing list
> [email protected]
> To unsubscribe, send email to [email protected].
> To get help, send an email containing "help" to
> [email protected].
>



-- 
Respectfully,

William C Roberts
_______________________________________________
Seandroid-list mailing list
[email protected]
To unsubscribe, send email to [email protected].
To get help, send an email containing "help" to 
[email protected].

Reply via email to