bootstrap
if (o.bootstrap) {
bname = o.bootstrap;
if (o.bootstrap &&
if (o.bootstrap && x < bss) {
if (!o.bootstrap) {
AOPT('B', char *, bootstrap, -1, "Bootstrap file") \
o.bootstrap = optarg;
do_install(const char *disk, const char *bootstrap, const char *bootname)
if ((fd = open(bootstrap, O_RDONLY)) == -1)
FATALIO("open %s", bootstrap);
FATALIO("fstat %s", bootstrap);
FATAL("%s must be a regular file", bootstrap);
FATALIO("read %s", bootstrap);
FATAL("read %s: short read", bootstrap);
FATALIO("open %s", bootstrap);
#define pmap_bootstrap PMAPNAME(bootstrap)
void bootstrap(void);
void bootstrap(void *, void *, void *, void *, void *);
px_init(struct stic_info *si, int bootstrap)
if (bootstrap) {
bootstrap = MAP_FAILED;
bootstrap = mmap(NULL, bootstrap_mapsize,
if (bootstrap == MAP_FAILED) {
lifdir = (void *)(bootstrap + HP300_LIF_DIRSTART);
rv = pwrite(params->fsfd, bootstrap, LIF_VOLDIRSIZE, 0);
rv = pwrite(params->fsfd, bootstrap + offset, size,
if (bootstrap != MAP_FAILED)
munmap(bootstrap, bootstrap_mapsize);
uint8_t *bootstrap;
} disk_buf, bootstrap;
if (params->s1stat.st_size > (off_t)(sizeof bootstrap)) {
rv = pread(params->s1fd, &bootstrap, params->s1stat.st_size, 0);
magic = (void *)(bootstrap.b + 512 - 16 + 4);
magic = (void *)(bootstrap.b + 512 * 2 + 4);
if (!is_zero(bootstrap.b + 512-2-64, 64)) {
if (!is_zero(bootstrap.b + 512, 512)) {
memcpy(bootstrap.b + 512-2-64, disk_buf.b + 512-2-64, 64);
memcpy(bootstrap.b + 512, disk_buf.b + 512, 512);
if (bootstrap.b[0] != 0xeb || bootstrap.b[2] != 0x90) {
bootstrap.b[0], bootstrap.b[1], bootstrap.b[2]);
if (disk_buf.b[1] > bootstrap.b[1]) {
if (!is_zero(disk_buf.b + 2 + bootstrap.b[1],
disk_buf.b[1] - bootstrap.b[1])) {
u = bootstrap.b[1];
memcpy(bootstrap.b + 2, disk_buf.b + 2, u);
memcpy(&disk_buf, &bootstrap, 512);
memcpy(disk_buf.b + 2 * 512, bootstrap.b + 2 * 512,