Dees_Troy | 51a0e82 | 2012-09-05 15:24:24 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef __CORE_FS_MGR_PRIV_H |
| 18 | #define __CORE_FS_MGR_PRIV_H |
| 19 | |
| 20 | #include <cutils/klog.h> |
| 21 | #include <fs_mgr.h> |
| 22 | |
| 23 | #define INFO(x...) KLOG_INFO("fs_mgr", x) |
| 24 | #define ERROR(x...) KLOG_ERROR("fs_mgr", x) |
| 25 | |
| 26 | #define CRYPTO_TMPFS_OPTIONS "size=128m,mode=0771,uid=1000,gid=1000" |
| 27 | |
| 28 | struct fstab_rec { |
| 29 | char *blk_dev; |
| 30 | char *mnt_point; |
| 31 | char *type; |
| 32 | unsigned long flags; |
| 33 | char *fs_options; |
| 34 | int fs_mgr_flags; |
| 35 | char *key_loc; |
| 36 | }; |
| 37 | |
| 38 | #define WAIT_TIMEOUT 5 |
| 39 | |
| 40 | /* fstab has the following format: |
| 41 | * |
| 42 | * Any line starting with a # is a comment and ignored |
| 43 | * |
| 44 | * Any blank line is ignored |
| 45 | * |
| 46 | * All other lines must be in this format: |
| 47 | * <source> <mount_point> <fs_type> <mount_flags> <fs_options> <fs_mgr_options> |
| 48 | * |
| 49 | * <mount_flags> is a comma separated list of flags that can be passed to the |
| 50 | * mount command. The list includes noatime, nosuid, nodev, nodiratime, |
| 51 | * ro, rw, remount, defaults. |
| 52 | * |
| 53 | * <fs_options> is a comma separated list of options accepted by the filesystem being |
| 54 | * mounted. It is passed directly to mount without being parsed |
| 55 | * |
| 56 | * <fs_mgr_options> is a comma separated list of flags that control the operation of |
| 57 | * the fs_mgr program. The list includes "wait", which will wait till |
| 58 | * the <source> file exists, and "check", which requests that the fs_mgr |
| 59 | * run an fscheck program on the <source> before mounting the filesystem. |
| 60 | * If check is specifed on a read-only filesystem, it is ignored. |
| 61 | * Also, "encryptable" means that filesystem can be encrypted. |
| 62 | * The "encryptable" flag _MUST_ be followed by a : and a string which |
| 63 | * is the location of the encryption keys. I can either be a path |
| 64 | * to a file or partition which contains the keys, or the word "footer" |
| 65 | * which means the keys are in the last 16 Kbytes of the partition |
| 66 | * containing the filesystem. |
| 67 | * |
| 68 | * When the fs_mgr is requested to mount all filesystems, it will first mount all the |
| 69 | * filesystems that do _NOT_ specify check (including filesystems that are read-only and |
| 70 | * specify check, because check is ignored in that case) and then it will check and mount |
| 71 | * filesystem marked with check. |
| 72 | * |
| 73 | */ |
| 74 | |
| 75 | #define MF_WAIT 0x1 |
| 76 | #define MF_CHECK 0x2 |
| 77 | #define MF_CRYPT 0x4 |
| 78 | |
| 79 | #endif /* __CORE_FS_MGR_PRIV_H */ |
| 80 | |