1*26ce53eaSkn /* $OpenBSD: installboot.h,v 1.16 2022/11/08 12:08:53 kn Exp $ */ 2a7036d21Sjsing /* 3a7036d21Sjsing * Copyright (c) 2012, 2013 Joel Sing <jsing@openbsd.org> 4a7036d21Sjsing * 5a7036d21Sjsing * Permission to use, copy, modify, and distribute this software for any 6a7036d21Sjsing * purpose with or without fee is hereby granted, provided that the above 7a7036d21Sjsing * copyright notice and this permission notice appear in all copies. 8a7036d21Sjsing * 9a7036d21Sjsing * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10a7036d21Sjsing * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11a7036d21Sjsing * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12a7036d21Sjsing * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13a7036d21Sjsing * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14a7036d21Sjsing * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15a7036d21Sjsing * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16a7036d21Sjsing */ 17a7036d21Sjsing 189de342e3Skn #include <dev/biovar.h> 199de342e3Skn 20666622eeSderaadt #include <stdlib.h> 21666622eeSderaadt 22a7036d21Sjsing extern int nowrite; 23a7036d21Sjsing extern int stages; 24a7036d21Sjsing extern int verbose; 25a7036d21Sjsing 2646339098Sjsing extern char *root; 27a7036d21Sjsing extern char *stage1; 28a7036d21Sjsing extern char *stage2; 29a7036d21Sjsing 30808c6500Sjsing #ifdef BOOTSTRAP 31f917af54Skrw void bootstrap(int, char *, char *); 32808c6500Sjsing #endif 33808c6500Sjsing 34597864b7Skrw int filecopy(const char *, const char *); 3546339098Sjsing char *fileprefix(const char *, const char *); 364a5d5189Svisa int fileprintf(const char *, const char *, ...) 374a5d5189Svisa __attribute__((format(printf, 2, 3))); 38c60e821eSjsg u_int32_t crc32(const u_char *, const u_int32_t); 3946339098Sjsing 40a7036d21Sjsing void md_init(void); 41a7036d21Sjsing void md_loadboot(void); 42c3e1bf61Skettenis void md_prepareboot(int, char *); 43a7036d21Sjsing void md_installboot(int, char *); 44a7036d21Sjsing 45a7036d21Sjsing #ifdef SOFTRAID 46092d8916Skn int sr_open_chunk(int, int, int, struct bioc_disk *, char **, char *); 47*26ce53eaSkn void sr_prepareboot(int, char *); 48a7036d21Sjsing void sr_installboot(int, char *); 49a7036d21Sjsing void sr_install_bootblk(int, int, int); 50a7036d21Sjsing void sr_install_bootldr(int, char *); 519de342e3Skn void sr_status(struct bio_status *); 52a7036d21Sjsing #endif 53