server-scripts/entry.sh

47 lines
930 B
Bash
Raw Normal View History

2020-01-25 16:41:16 +00:00
#!/bin/bash
2020-01-29 12:33:53 +00:00
source $(dirname $0)/utils.sh
2020-01-25 16:41:16 +00:00
function first_stage(){
echo foo first_stage
2020-01-28 23:02:23 +00:00
echo creating image file
2020-01-28 22:59:27 +00:00
dd if=/dev/zero of=/root/disk.img bs=1M count=512
2020-01-28 23:12:01 +00:00
LODEV=$(losetup --show -f /root/disk.img)
2020-01-28 22:59:27 +00:00
(
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
2020-01-28 23:12:01 +00:00
) | fdisk ${LODEV}
losetup -d ${LODEV}
LODEV=$(losetup --show -fP /root/disk.img)
2020-01-29 12:33:53 +00:00
2020-01-28 23:16:59 +00:00
echo using device $LODEV
2020-01-25 18:27:03 +00:00
echo mount divice to $TARGET
2020-01-29 12:33:53 +00:00
mount $LODEVp1 $TARGET
echo debootstrap sid $TARGET
2020-01-28 22:59:27 +00:00
2020-01-25 16:41:16 +00:00
}
function second_stage(){
echo bar second_stage
}
2020-01-29 12:33:53 +00:00
function test_fun(){
#choose_one test1 | prefix_time
#sleep 1
block_devices | choose_one -
echo "> "$test
#sleep 1
#choose_one | prefix_time
}
if [ $# -eq 1 ]; then
if [ $1 = "test" ]; then
test_fun
fi
fi