pinigin

Untitled

Nov 22nd, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.98 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Disk parameters
  4.  
  5. DISK_SIZE_M=72
  6. DISK_FILE=/tmp/disk.img
  7. DISK_FS="${DISK_FILE}@@1M"
  8. DISK_FSID=42424242
  9. DISK_FSLABEL=PINOSKRN
  10.  
  11. # The config file, make sure it exists.
  12. LOADER_RCFILE=./loader.rc
  13.  
  14. # Create an emtpy sparse disk and partition it.
  15. truncate -s${DISK_SIZE_M}M "$DISK_FILE"
  16. parted -s "$DISK_FILE" unit MiB mklabel msdos mkpart primary fat32 1 '100%'
  17.  
  18. # Format as FAT32.
  19. mformat -i "$DISK_FS" -FN "$DISK_FSID" -v "$DISK_FSLABEL"
  20.  
  21. # Create /boot and install the configuration file.
  22. # (make sure to customize it first, if needed)
  23. mmd     -i "$DISK_FS" /boot
  24. mcopy   -i "$DISK_FS" "$LOADER_RCFILE" ::/boot/loader.rc
  25.  
  26. # Install Stoomboot stage1 & stage2.
  27. tools/loader-install.pl \
  28.     --mbr \
  29.     --stage1-mbr   stage1/bin/stoomboot-stage1-mbr.bin \
  30.     --stage2       stage2/bin/stoomboot-stage2.bin \
  31.     --stage2-lba   1 \
  32.     --loader-fs-id "$DISK_FSID" \
  33.     --img          "$DISK_FILE"
  34.  
  35. mcopy -i "$DISK_FS" pinos.k ::/boot
  36. cp /tmp/disk.img disk.img
Advertisement
Add Comment
Please, Sign In to add comment