17574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall/*
27574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * Copyright (C) 2012 The Android Open Source Project
37574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
47574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * Licensed under the Apache License, Version 2.0 (the "License");
57574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * you may not use this file except in compliance with the License.
67574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * You may obtain a copy of the License at
77574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
87574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *      http://www.apache.org/licenses/LICENSE-2.0
97574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
107574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * Unless required by applicable law or agreed to in writing, software
117574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * distributed under the License is distributed on an "AS IS" BASIS,
127574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * See the License for the specific language governing permissions and
147574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * limitations under the License.
157574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall */
167574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
177574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#ifndef __CORE_FS_MGR_PRIV_H
187574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#define __CORE_FS_MGR_PRIV_H
197574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
207574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#include <cutils/klog.h>
217574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#include <fs_mgr.h>
227574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
237574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#define INFO(x...)    KLOG_INFO("fs_mgr", x)
247574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#define ERROR(x...)   KLOG_ERROR("fs_mgr", x)
257574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
26e29cbd3372e5af761d3c2423723182acf6951166JP Abgrall#define CRYPTO_TMPFS_OPTIONS "size=256m,mode=0771,uid=1000,gid=1000"
277574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
287b9c33b1e0e47f72d0af35d8a948900697da5871Elliott Hughes#define WAIT_TIMEOUT 20
297574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
307574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall/* fstab has the following format:
317574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
327574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * Any line starting with a # is a comment and ignored
337574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
347574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * Any blank line is ignored
357574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
367574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * All other lines must be in this format:
377574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *   <source>  <mount_point> <fs_type> <mount_flags> <fs_options> <fs_mgr_options>
387574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
397574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *   <mount_flags> is a comma separated list of flags that can be passed to the
407574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                 mount command.  The list includes noatime, nosuid, nodev, nodiratime,
417574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                 ro, rw, remount, defaults.
427574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
437574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *   <fs_options> is a comma separated list of options accepted by the filesystem being
447574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                mounted.  It is passed directly to mount without being parsed
457574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
467574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *   <fs_mgr_options> is a comma separated list of flags that control the operation of
477574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     the fs_mgr program.  The list includes "wait", which will wait till
487574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     the <source> file exists, and "check", which requests that the fs_mgr
497574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     run an fscheck program on the <source> before mounting the filesystem.
507574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     If check is specifed on a read-only filesystem, it is ignored.
517574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     Also, "encryptable" means that filesystem can be encrypted.
52ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall *                     The "encryptable" flag _MUST_ be followed by a = and a string which
53ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall *                     is the location of the encryption keys.  It can either be a path
547574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     to a file or partition which contains the keys, or the word "footer"
557574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     which means the keys are in the last 16 Kbytes of the partition
567574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *                     containing the filesystem.
577574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
587574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * When the fs_mgr is requested to mount all filesystems, it will first mount all the
597574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * filesystems that do _NOT_ specify check (including filesystems that are read-only and
607574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * specify check, because check is ignored in that case) and then it will check and mount
617574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall * filesystem marked with check.
627574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall *
637574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall */
647574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
65ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall#define MF_WAIT         0x1
66ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall#define MF_CHECK        0x2
67ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall#define MF_CRYPT        0x4
68ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall#define MF_NONREMOVABLE 0x8
69ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall#define MF_VOLDMANAGED  0x10
70ab6b852235d99d752678312c155a3f1c140fb483Ken Sumrall#define MF_LENGTH       0x20
716c2c121386f5e19ed74dc8d706bcb1e6f65fc1baKen Sumrall#define MF_RECOVERYONLY 0x40
725bc31a2632f453e03edac714b865773970bba608Ken Sumrall#define MF_SWAPPRIO     0x80
735bc31a2632f453e03edac714b865773970bba608Ken Sumrall#define MF_ZRAMSIZE     0x100
743ad3d1c4b5856d4e314febc5671c74e78a76db00Geremy Condra#define MF_VERIFY       0x200
752e5ae0a4f90ad7a2a1aa9382abb97d9450209c50Paul Lawrence#define MF_FORCECRYPT   0x400
7622f63e393fbc87494b6d9be3ed93b8289f41b123Todd Poynor#define MF_NOEMULATEDSD 0x800 /* no emulated sdcard daemon, sd card is the only
7722f63e393fbc87494b6d9be3ed93b8289f41b123Todd Poynor                                 external storage */
783ad3d1c4b5856d4e314febc5671c74e78a76db00Geremy Condra
793ad3d1c4b5856d4e314febc5671c74e78a76db00Geremy Condra#define DM_BUF_SIZE 4096
807574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
817574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall#endif /* __CORE_FS_MGR_PRIV_H */
827574c035b2dcf8316c562c648113be6be65cb061Ken Sumrall
83