laptop-scripts/entry.sh
2020-01-29 00:16:59 +01:00

27 lines
633 B
Bash
Executable file

#!/bin/bash
function first_stage(){
echo foo first_stage
echo creating image file
dd if=/dev/zero of=/root/disk.img bs=1M count=512
LODEV=$(losetup --show -f /root/disk.img)
(
echo o # Create a new empty DOS partition table
echo n # Add a new partition
echo p # Primary partition
echo 1 # Partition number
echo # First sector (Accept default: 1)
echo # Last sector (Accept default: varies)
echo w # Write changes
) | fdisk ${LODEV}
losetup -d ${LODEV}
LODEV=$(losetup --show -fP /root/disk.img)
lsblk
echo using device $LODEV
echo mount divice to $TARGET
}
function second_stage(){
echo bar second_stage
}