#include <stdio.h>
#include <sys/types.h>

#include "ubixfs.h"

int main(int argc,char **argv) {
  FILE *fd;
  struct ubixDiskLabel *d = (struct ubixDiskLabel *)malloc(512);
  printf("Building Disk Label\n");
  d->magicNum = UBIXDISKMAGIC;
  d->magicNum2 = UBIXDISKMAGIC;
  d->numPartitions = 2;
  d->partitions[0].p_size    = 204361;
  d->partitions[0].p_offset  = 50;
  d->partitions[0].p_fstype  = 0xAD;
  d->partitions[0].p_bsize   = 0x8;
  d->partitions[1].p_size    = 2000;
  d->partitions[1].p_offset  = 1000;
  d->partitions[1].p_fstype  = 0xAD;
  d->partitions[1].p_bsize   = 0x8;
  d->partitions[2].p_size    = 0;
  d->partitions[2].p_offset  = 0;
  d->partitions[2].p_fstype  = 0;
  d->partitions[2].p_bsize   = 0;
  d->partitions[3].p_size    = 0;
  d->partitions[3].p_offset  = 0;
  d->partitions[3].p_fstype  = 0;
  d->partitions[3].p_bsize   = 0;
  fd = fopen(argv[1],"wb");
  fseek(fd,512 * (atoi(argv[2])),0);
  fwrite(d,512,1,fd); 
  }
