Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2019 Eugeniu Rosca <rosca.eugeniu@gmail.com> |
| 4 | * |
| 5 | * Command to read/modify/write Android BCB fields |
| 6 | */ |
| 7 | |
| 8 | #include <android_bootloader_message.h> |
| 9 | #include <command.h> |
| 10 | #include <common.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 11 | #include <log.h> |
Simon Glass | e6f6f9e | 2020-05-10 11:39:58 -0600 | [diff] [blame] | 12 | #include <part.h> |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 13 | |
| 14 | enum bcb_cmd { |
| 15 | BCB_CMD_LOAD, |
| 16 | BCB_CMD_FIELD_SET, |
| 17 | BCB_CMD_FIELD_CLEAR, |
| 18 | BCB_CMD_FIELD_TEST, |
| 19 | BCB_CMD_FIELD_DUMP, |
| 20 | BCB_CMD_STORE, |
| 21 | }; |
| 22 | |
| 23 | static int bcb_dev = -1; |
| 24 | static int bcb_part = -1; |
| 25 | static struct bootloader_message bcb = { { 0 } }; |
| 26 | |
| 27 | static int bcb_cmd_get(char *cmd) |
| 28 | { |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 29 | if (!strcmp(cmd, "load")) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 30 | return BCB_CMD_LOAD; |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 31 | if (!strcmp(cmd, "set")) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 32 | return BCB_CMD_FIELD_SET; |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 33 | if (!strcmp(cmd, "clear")) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 34 | return BCB_CMD_FIELD_CLEAR; |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 35 | if (!strcmp(cmd, "test")) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 36 | return BCB_CMD_FIELD_TEST; |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 37 | if (!strcmp(cmd, "store")) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 38 | return BCB_CMD_STORE; |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 39 | if (!strcmp(cmd, "dump")) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 40 | return BCB_CMD_FIELD_DUMP; |
| 41 | else |
| 42 | return -1; |
| 43 | } |
| 44 | |
| 45 | static int bcb_is_misused(int argc, char *const argv[]) |
| 46 | { |
| 47 | int cmd = bcb_cmd_get(argv[0]); |
| 48 | |
| 49 | switch (cmd) { |
| 50 | case BCB_CMD_LOAD: |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 51 | case BCB_CMD_FIELD_SET: |
| 52 | if (argc != 3) |
| 53 | goto err; |
| 54 | break; |
| 55 | case BCB_CMD_FIELD_TEST: |
| 56 | if (argc != 4) |
| 57 | goto err; |
| 58 | break; |
| 59 | case BCB_CMD_FIELD_CLEAR: |
| 60 | if (argc != 1 && argc != 2) |
| 61 | goto err; |
| 62 | break; |
| 63 | case BCB_CMD_STORE: |
| 64 | if (argc != 1) |
| 65 | goto err; |
| 66 | break; |
| 67 | case BCB_CMD_FIELD_DUMP: |
| 68 | if (argc != 2) |
| 69 | goto err; |
| 70 | break; |
| 71 | default: |
| 72 | printf("Error: 'bcb %s' not supported\n", argv[0]); |
| 73 | return -1; |
| 74 | } |
| 75 | |
| 76 | if (cmd != BCB_CMD_LOAD && (bcb_dev < 0 || bcb_part < 0)) { |
| 77 | printf("Error: Please, load BCB first!\n"); |
| 78 | return -1; |
| 79 | } |
| 80 | |
| 81 | return 0; |
| 82 | err: |
| 83 | printf("Error: Bad usage of 'bcb %s'\n", argv[0]); |
| 84 | |
| 85 | return -1; |
| 86 | } |
| 87 | |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 88 | static int bcb_field_get(char *name, char **fieldp, int *sizep) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 89 | { |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 90 | if (!strcmp(name, "command")) { |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 91 | *fieldp = bcb.command; |
| 92 | *sizep = sizeof(bcb.command); |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 93 | } else if (!strcmp(name, "status")) { |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 94 | *fieldp = bcb.status; |
| 95 | *sizep = sizeof(bcb.status); |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 96 | } else if (!strcmp(name, "recovery")) { |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 97 | *fieldp = bcb.recovery; |
| 98 | *sizep = sizeof(bcb.recovery); |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 99 | } else if (!strcmp(name, "stage")) { |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 100 | *fieldp = bcb.stage; |
| 101 | *sizep = sizeof(bcb.stage); |
Eugeniu Rosca | 739168c | 2019-07-19 23:26:13 +0200 | [diff] [blame] | 102 | } else if (!strcmp(name, "reserved")) { |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 103 | *fieldp = bcb.reserved; |
| 104 | *sizep = sizeof(bcb.reserved); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 105 | } else { |
| 106 | printf("Error: Unknown bcb field '%s'\n", name); |
| 107 | return -1; |
| 108 | } |
| 109 | |
| 110 | return 0; |
| 111 | } |
| 112 | |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 113 | static int __bcb_load(int devnum, const char *partp) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 114 | { |
| 115 | struct blk_desc *desc; |
Simon Glass | 0528979 | 2020-05-10 11:39:57 -0600 | [diff] [blame] | 116 | struct disk_partition info; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 117 | u64 cnt; |
| 118 | char *endp; |
| 119 | int part, ret; |
| 120 | |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 121 | desc = blk_get_devnum_by_type(IF_TYPE_MMC, devnum); |
| 122 | if (!desc) { |
| 123 | ret = -ENODEV; |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 124 | goto err_read_fail; |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 125 | } |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 126 | |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 127 | part = simple_strtoul(partp, &endp, 0); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 128 | if (*endp == '\0') { |
| 129 | ret = part_get_info(desc, part, &info); |
| 130 | if (ret) |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 131 | goto err_read_fail; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 132 | } else { |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 133 | part = part_get_info_by_name(desc, partp, &info); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 134 | if (part < 0) { |
| 135 | ret = part; |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 136 | goto err_read_fail; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 137 | } |
| 138 | } |
| 139 | |
| 140 | cnt = DIV_ROUND_UP(sizeof(struct bootloader_message), info.blksz); |
| 141 | if (cnt > info.size) |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 142 | goto err_too_small; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 143 | |
| 144 | if (blk_dread(desc, info.start, cnt, &bcb) != cnt) { |
| 145 | ret = -EIO; |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 146 | goto err_read_fail; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | bcb_dev = desc->devnum; |
| 150 | bcb_part = part; |
| 151 | debug("%s: Loaded from mmc %d:%d\n", __func__, bcb_dev, bcb_part); |
| 152 | |
| 153 | return CMD_RET_SUCCESS; |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 154 | err_read_fail: |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 155 | printf("Error: mmc %d:%s read failed (%d)\n", devnum, partp, ret); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 156 | goto err; |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 157 | err_too_small: |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 158 | printf("Error: mmc %d:%s too small!", devnum, partp); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 159 | goto err; |
| 160 | err: |
| 161 | bcb_dev = -1; |
| 162 | bcb_part = -1; |
| 163 | |
| 164 | return CMD_RET_FAILURE; |
| 165 | } |
| 166 | |
Eugeniu Rosca | 24e85bb | 2020-10-23 11:52:19 +0300 | [diff] [blame] | 167 | static int do_bcb_load(struct cmd_tbl *cmdtp, int flag, int argc, |
| 168 | char * const argv[]) |
| 169 | { |
| 170 | char *endp; |
| 171 | int devnum = simple_strtoul(argv[1], &endp, 0); |
| 172 | |
| 173 | if (*endp != '\0') { |
| 174 | printf("Error: Device id '%s' not a number\n", argv[1]); |
| 175 | return CMD_RET_FAILURE; |
| 176 | } |
| 177 | |
| 178 | return __bcb_load(devnum, argv[2]); |
| 179 | } |
| 180 | |
Eugeniu Rosca | 02ebe6d | 2020-10-23 11:52:20 +0300 | [diff] [blame^] | 181 | static int __bcb_set(char *fieldp, char *valp) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 182 | { |
| 183 | int size, len; |
| 184 | char *field, *str, *found; |
| 185 | |
Eugeniu Rosca | 02ebe6d | 2020-10-23 11:52:20 +0300 | [diff] [blame^] | 186 | if (bcb_field_get(fieldp, &field, &size)) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 187 | return CMD_RET_FAILURE; |
| 188 | |
Eugeniu Rosca | 02ebe6d | 2020-10-23 11:52:20 +0300 | [diff] [blame^] | 189 | len = strlen(valp); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 190 | if (len >= size) { |
| 191 | printf("Error: sizeof('%s') = %d >= %d = sizeof(bcb.%s)\n", |
Eugeniu Rosca | 02ebe6d | 2020-10-23 11:52:20 +0300 | [diff] [blame^] | 192 | valp, len, size, fieldp); |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 193 | return CMD_RET_FAILURE; |
| 194 | } |
Eugeniu Rosca | 02ebe6d | 2020-10-23 11:52:20 +0300 | [diff] [blame^] | 195 | str = valp; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 196 | |
| 197 | field[0] = '\0'; |
| 198 | while ((found = strsep(&str, ":"))) { |
| 199 | if (field[0] != '\0') |
| 200 | strcat(field, "\n"); |
| 201 | strcat(field, found); |
| 202 | } |
| 203 | |
| 204 | return CMD_RET_SUCCESS; |
| 205 | } |
| 206 | |
Eugeniu Rosca | 02ebe6d | 2020-10-23 11:52:20 +0300 | [diff] [blame^] | 207 | static int do_bcb_set(struct cmd_tbl *cmdtp, int flag, int argc, |
| 208 | char * const argv[]) |
| 209 | { |
| 210 | return __bcb_set(argv[1], argv[2]); |
| 211 | } |
| 212 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 213 | static int do_bcb_clear(struct cmd_tbl *cmdtp, int flag, int argc, |
| 214 | char *const argv[]) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 215 | { |
| 216 | int size; |
| 217 | char *field; |
| 218 | |
| 219 | if (argc == 1) { |
| 220 | memset(&bcb, 0, sizeof(bcb)); |
| 221 | return CMD_RET_SUCCESS; |
| 222 | } |
| 223 | |
| 224 | if (bcb_field_get(argv[1], &field, &size)) |
| 225 | return CMD_RET_FAILURE; |
| 226 | |
| 227 | memset(field, 0, size); |
| 228 | |
| 229 | return CMD_RET_SUCCESS; |
| 230 | } |
| 231 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 232 | static int do_bcb_test(struct cmd_tbl *cmdtp, int flag, int argc, |
| 233 | char *const argv[]) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 234 | { |
| 235 | int size; |
| 236 | char *field; |
| 237 | char *op = argv[2]; |
| 238 | |
| 239 | if (bcb_field_get(argv[1], &field, &size)) |
| 240 | return CMD_RET_FAILURE; |
| 241 | |
| 242 | if (*op == '=' && *(op + 1) == '\0') { |
| 243 | if (!strncmp(argv[3], field, size)) |
| 244 | return CMD_RET_SUCCESS; |
| 245 | else |
| 246 | return CMD_RET_FAILURE; |
| 247 | } else if (*op == '~' && *(op + 1) == '\0') { |
| 248 | if (!strstr(field, argv[3])) |
| 249 | return CMD_RET_FAILURE; |
| 250 | else |
| 251 | return CMD_RET_SUCCESS; |
| 252 | } else { |
| 253 | printf("Error: Unknown operator '%s'\n", op); |
| 254 | } |
| 255 | |
| 256 | return CMD_RET_FAILURE; |
| 257 | } |
| 258 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 259 | static int do_bcb_dump(struct cmd_tbl *cmdtp, int flag, int argc, |
| 260 | char *const argv[]) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 261 | { |
| 262 | int size; |
| 263 | char *field; |
| 264 | |
| 265 | if (bcb_field_get(argv[1], &field, &size)) |
| 266 | return CMD_RET_FAILURE; |
| 267 | |
| 268 | print_buffer((ulong)field - (ulong)&bcb, (void *)field, 1, size, 16); |
| 269 | |
| 270 | return CMD_RET_SUCCESS; |
| 271 | } |
| 272 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 273 | static int do_bcb_store(struct cmd_tbl *cmdtp, int flag, int argc, |
| 274 | char *const argv[]) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 275 | { |
| 276 | struct blk_desc *desc; |
Simon Glass | 0528979 | 2020-05-10 11:39:57 -0600 | [diff] [blame] | 277 | struct disk_partition info; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 278 | u64 cnt; |
| 279 | int ret; |
| 280 | |
| 281 | desc = blk_get_devnum_by_type(IF_TYPE_MMC, bcb_dev); |
| 282 | if (!desc) { |
| 283 | ret = -ENODEV; |
| 284 | goto err; |
| 285 | } |
| 286 | |
| 287 | ret = part_get_info(desc, bcb_part, &info); |
| 288 | if (ret) |
| 289 | goto err; |
| 290 | |
| 291 | cnt = DIV_ROUND_UP(sizeof(struct bootloader_message), info.blksz); |
| 292 | |
| 293 | if (blk_dwrite(desc, info.start, cnt, &bcb) != cnt) { |
| 294 | ret = -EIO; |
| 295 | goto err; |
| 296 | } |
| 297 | |
| 298 | return CMD_RET_SUCCESS; |
| 299 | err: |
| 300 | printf("Error: mmc %d:%d write failed (%d)\n", bcb_dev, bcb_part, ret); |
| 301 | |
| 302 | return CMD_RET_FAILURE; |
| 303 | } |
| 304 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 305 | static struct cmd_tbl cmd_bcb_sub[] = { |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 306 | U_BOOT_CMD_MKENT(load, CONFIG_SYS_MAXARGS, 1, do_bcb_load, "", ""), |
| 307 | U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 1, do_bcb_set, "", ""), |
| 308 | U_BOOT_CMD_MKENT(clear, CONFIG_SYS_MAXARGS, 1, do_bcb_clear, "", ""), |
| 309 | U_BOOT_CMD_MKENT(test, CONFIG_SYS_MAXARGS, 1, do_bcb_test, "", ""), |
| 310 | U_BOOT_CMD_MKENT(dump, CONFIG_SYS_MAXARGS, 1, do_bcb_dump, "", ""), |
| 311 | U_BOOT_CMD_MKENT(store, CONFIG_SYS_MAXARGS, 1, do_bcb_store, "", ""), |
| 312 | }; |
| 313 | |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 314 | static int do_bcb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 315 | { |
Simon Glass | 0914011 | 2020-05-10 11:40:03 -0600 | [diff] [blame] | 316 | struct cmd_tbl *c; |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 317 | |
| 318 | if (argc < 2) |
| 319 | return CMD_RET_USAGE; |
| 320 | |
| 321 | argc--; |
| 322 | argv++; |
| 323 | |
| 324 | c = find_cmd_tbl(argv[0], cmd_bcb_sub, ARRAY_SIZE(cmd_bcb_sub)); |
| 325 | if (!c) |
| 326 | return CMD_RET_USAGE; |
| 327 | |
| 328 | if (bcb_is_misused(argc, argv)) { |
Eugeniu Rosca | 37f1811 | 2019-07-19 23:26:14 +0200 | [diff] [blame] | 329 | /* |
| 330 | * We try to improve the user experience by reporting the |
Eugeniu Rosca | db7b7a0 | 2019-05-23 17:32:22 +0200 | [diff] [blame] | 331 | * root-cause of misusage, so don't return CMD_RET_USAGE, |
| 332 | * since the latter prints out the full-blown help text |
| 333 | */ |
| 334 | return CMD_RET_FAILURE; |
| 335 | } |
| 336 | |
| 337 | return c->cmd(cmdtp, flag, argc, argv); |
| 338 | } |
| 339 | |
| 340 | U_BOOT_CMD( |
| 341 | bcb, CONFIG_SYS_MAXARGS, 1, do_bcb, |
| 342 | "Load/set/clear/test/dump/store Android BCB fields", |
| 343 | "load <dev> <part> - load BCB from mmc <dev>:<part>\n" |
| 344 | "bcb set <field> <val> - set BCB <field> to <val>\n" |
| 345 | "bcb clear [<field>] - clear BCB <field> or all fields\n" |
| 346 | "bcb test <field> <op> <val> - test BCB <field> against <val>\n" |
| 347 | "bcb dump <field> - dump BCB <field>\n" |
| 348 | "bcb store - store BCB back to mmc\n" |
| 349 | "\n" |
| 350 | "Legend:\n" |
| 351 | "<dev> - MMC device index containing the BCB partition\n" |
| 352 | "<part> - MMC partition index or name containing the BCB\n" |
| 353 | "<field> - one of {command,status,recovery,stage,reserved}\n" |
| 354 | "<op> - the binary operator used in 'bcb test':\n" |
| 355 | " '=' returns true if <val> matches the string stored in <field>\n" |
| 356 | " '~' returns true if <val> matches a subset of <field>'s string\n" |
| 357 | "<val> - string/text provided as input to bcb {set,test}\n" |
| 358 | " NOTE: any ':' character in <val> will be replaced by line feed\n" |
| 359 | " during 'bcb set' and used as separator by upper layers\n" |
| 360 | ); |