Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [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 | |
Elliott Hughes | 246c18c | 2015-10-09 11:52:00 -0700 | [diff] [blame] | 23 | __BEGIN_DECLS |
| 24 | |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 25 | #define INFO(x...) KLOG_INFO("fs_mgr", x) |
Nick Kralevich | 7294eb6 | 2015-02-05 16:02:42 -0800 | [diff] [blame] | 26 | #define WARNING(x...) KLOG_WARNING("fs_mgr", x) |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 27 | #define ERROR(x...) KLOG_ERROR("fs_mgr", x) |
| 28 | |
JP Abgrall | e29cbd3 | 2014-06-27 02:20:20 -0700 | [diff] [blame] | 29 | #define CRYPTO_TMPFS_OPTIONS "size=256m,mode=0771,uid=1000,gid=1000" |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 30 | |
Elliott Hughes | 7b9c33b | 2013-07-11 18:57:39 -0700 | [diff] [blame] | 31 | #define WAIT_TIMEOUT 20 |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 32 | |
| 33 | /* fstab has the following format: |
| 34 | * |
| 35 | * Any line starting with a # is a comment and ignored |
| 36 | * |
| 37 | * Any blank line is ignored |
| 38 | * |
| 39 | * All other lines must be in this format: |
| 40 | * <source> <mount_point> <fs_type> <mount_flags> <fs_options> <fs_mgr_options> |
| 41 | * |
| 42 | * <mount_flags> is a comma separated list of flags that can be passed to the |
| 43 | * mount command. The list includes noatime, nosuid, nodev, nodiratime, |
| 44 | * ro, rw, remount, defaults. |
| 45 | * |
| 46 | * <fs_options> is a comma separated list of options accepted by the filesystem being |
| 47 | * mounted. It is passed directly to mount without being parsed |
| 48 | * |
| 49 | * <fs_mgr_options> is a comma separated list of flags that control the operation of |
| 50 | * the fs_mgr program. The list includes "wait", which will wait till |
| 51 | * the <source> file exists, and "check", which requests that the fs_mgr |
| 52 | * run an fscheck program on the <source> before mounting the filesystem. |
| 53 | * If check is specifed on a read-only filesystem, it is ignored. |
| 54 | * Also, "encryptable" means that filesystem can be encrypted. |
Ken Sumrall | ab6b852 | 2013-02-13 12:58:40 -0800 | [diff] [blame] | 55 | * The "encryptable" flag _MUST_ be followed by a = and a string which |
| 56 | * is the location of the encryption keys. It can either be a path |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 57 | * to a file or partition which contains the keys, or the word "footer" |
| 58 | * which means the keys are in the last 16 Kbytes of the partition |
| 59 | * containing the filesystem. |
| 60 | * |
| 61 | * When the fs_mgr is requested to mount all filesystems, it will first mount all the |
| 62 | * filesystems that do _NOT_ specify check (including filesystems that are read-only and |
| 63 | * specify check, because check is ignored in that case) and then it will check and mount |
| 64 | * filesystem marked with check. |
| 65 | * |
| 66 | */ |
| 67 | |
Ken Sumrall | ab6b852 | 2013-02-13 12:58:40 -0800 | [diff] [blame] | 68 | #define MF_WAIT 0x1 |
| 69 | #define MF_CHECK 0x2 |
| 70 | #define MF_CRYPT 0x4 |
| 71 | #define MF_NONREMOVABLE 0x8 |
| 72 | #define MF_VOLDMANAGED 0x10 |
| 73 | #define MF_LENGTH 0x20 |
Ken Sumrall | 6c2c121 | 2013-02-22 17:36:21 -0800 | [diff] [blame] | 74 | #define MF_RECOVERYONLY 0x40 |
Ken Sumrall | 5bc31a2 | 2013-07-08 19:11:55 -0700 | [diff] [blame] | 75 | #define MF_SWAPPRIO 0x80 |
| 76 | #define MF_ZRAMSIZE 0x100 |
Geremy Condra | 3ad3d1c | 2013-02-22 18:11:41 -0800 | [diff] [blame] | 77 | #define MF_VERIFY 0x200 |
Paul Lawrence | 2e5ae0a | 2014-04-04 09:34:19 -0700 | [diff] [blame] | 78 | #define MF_FORCECRYPT 0x400 |
Todd Poynor | 22f63e3 | 2014-07-01 17:57:13 -0700 | [diff] [blame] | 79 | #define MF_NOEMULATEDSD 0x800 /* no emulated sdcard daemon, sd card is the only |
| 80 | external storage */ |
JP Abgrall | fe6fcc4 | 2015-03-05 17:30:53 -0800 | [diff] [blame] | 81 | #define MF_NOTRIM 0x1000 |
Paul Lawrence | c410b3b | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 82 | #define MF_FILEENCRYPTION 0x2000 |
Ed Tam | e498c7c | 2015-04-13 18:01:33 -0700 | [diff] [blame] | 83 | #define MF_FORMATTABLE 0x4000 |
Daniel Rosenberg | 8bb2f36 | 2015-08-27 13:42:20 -0700 | [diff] [blame] | 84 | #define MF_SLOTSELECT 0x8000 |
Paul Lawrence | b262d68 | 2015-10-29 10:31:02 -0700 | [diff] [blame] | 85 | #define MF_FORCEFDEORFBE 0x10000 |
Daniel Rosenberg | d38e3c5 | 2016-04-07 20:10:25 -0700 | [diff] [blame] | 86 | #define MF_NOFAIL 0x40000 |
Geremy Condra | 3ad3d1c | 2013-02-22 18:11:41 -0800 | [diff] [blame] | 87 | |
| 88 | #define DM_BUF_SIZE 4096 |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 89 | |
Sami Tolvanen | 214f33b | 2014-12-18 16:15:30 +0000 | [diff] [blame] | 90 | int fs_mgr_set_blk_ro(const char *blockdev); |
David Zeuthen | 227ef3c | 2015-09-03 12:23:12 -0400 | [diff] [blame] | 91 | int fs_mgr_update_for_slotselect(struct fstab *fstab); |
Sami Tolvanen | 214f33b | 2014-12-18 16:15:30 +0000 | [diff] [blame] | 92 | |
Elliott Hughes | 246c18c | 2015-10-09 11:52:00 -0700 | [diff] [blame] | 93 | __END_DECLS |
| 94 | |
Ken Sumrall | 7574c03 | 2012-01-06 19:09:42 -0800 | [diff] [blame] | 95 | #endif /* __CORE_FS_MGR_PRIV_H */ |