Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Disk parameters
- DISK_SIZE_M=72
- DISK_FILE=/tmp/disk.img
- DISK_FS="${DISK_FILE}@@1M"
- DISK_FSID=42424242
- DISK_FSLABEL=PINOSKRN
- # The config file, make sure it exists.
- LOADER_RCFILE=./loader.rc
- # Create an emtpy sparse disk and partition it.
- truncate -s${DISK_SIZE_M}M "$DISK_FILE"
- parted -s "$DISK_FILE" unit MiB mklabel msdos mkpart primary fat32 1 '100%'
- # Format as FAT32.
- mformat -i "$DISK_FS" -FN "$DISK_FSID" -v "$DISK_FSLABEL"
- # Create /boot and install the configuration file.
- # (make sure to customize it first, if needed)
- mmd -i "$DISK_FS" /boot
- mcopy -i "$DISK_FS" "$LOADER_RCFILE" ::/boot/loader.rc
- # Install Stoomboot stage1 & stage2.
- tools/loader-install.pl \
- --mbr \
- --stage1-mbr stage1/bin/stoomboot-stage1-mbr.bin \
- --stage2 stage2/bin/stoomboot-stage2.bin \
- --stage2-lba 1 \
- --loader-fs-id "$DISK_FSID" \
- --img "$DISK_FILE"
- mcopy -i "$DISK_FS" pinos.k ::/boot
- cp /tmp/disk.img disk.img
Advertisement
Add Comment
Please, Sign In to add comment