changed ssh path for boot_tiny directory
- include mbr.bin there
This commit is contained in:
23
mkusb.sh
23
mkusb.sh
@ -1,25 +1,10 @@
|
|||||||
# name of the USB stick to be created
|
# name of the USB stick to be created
|
||||||
NAME=BOOT_TINY
|
NAME=BOOT_TINY
|
||||||
|
|
||||||
echo "enter source for tinylinux files, e.g. zolliker@mpc1704:switchdrive/apu/boot_tiny"
|
echo "enter ssh path of parent directory for boot_tiny, e.g. l_samenv@samenv:boxes"
|
||||||
read SRC
|
read SRC
|
||||||
|
|
||||||
scp -r $SRC ./
|
scp -r $SRC/boot_tiny ./
|
||||||
|
|
||||||
# create (overwrite) syslinux.cfg
|
|
||||||
cat > boot_tiny/syslinux.cfg << "EOF"
|
|
||||||
SERIAL 0 115200
|
|
||||||
CONSOLE 0
|
|
||||||
default centos
|
|
||||||
ALLOWOPTIONS 0
|
|
||||||
TIMEOUT 600
|
|
||||||
label centos
|
|
||||||
kernel vmlinuz
|
|
||||||
append initrd=core.gz inst.stage2=hd:LABEL=USBNAME quiet console=ttyS0,115200n8
|
|
||||||
EOF
|
|
||||||
sed -i -- "s/USBNAME/$NAME/g" boot_tiny/syslinux.cfg
|
|
||||||
|
|
||||||
ls boot_tiny
|
|
||||||
|
|
||||||
# list removeable disks
|
# list removeable disks
|
||||||
DISKS=()
|
DISKS=()
|
||||||
@ -36,7 +21,7 @@ do
|
|||||||
fi
|
fi
|
||||||
done < <(lsblk -l --output RM,TYPE,NAME,SIZE,LABEL,VENDOR,MODEL)
|
done < <(lsblk -l --output RM,TYPE,NAME,SIZE,LABEL,VENDOR,MODEL)
|
||||||
|
|
||||||
echo "which device (${DISKS[@]})?"
|
echo "which device? should be one of: ${DISKS[@]}"
|
||||||
read DEVICE
|
read DEVICE
|
||||||
|
|
||||||
if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then
|
if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then
|
||||||
@ -55,7 +40,7 @@ if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then
|
|||||||
mkfs.vfat -n $NAME -I ${DEVICE}1
|
mkfs.vfat -n $NAME -I ${DEVICE}1
|
||||||
|
|
||||||
syslinux -i ${DEVICE}1
|
syslinux -i ${DEVICE}1
|
||||||
dd conv=notrunc bs=440 count=1 if=mbr.bin of=${DEVICE}
|
dd conv=notrunc bs=440 count=1 if=boot_tiny/mbr.bin of=${DEVICE}
|
||||||
parted ${DEVICE} set 1 boot on
|
parted ${DEVICE} set 1 boot on
|
||||||
|
|
||||||
mkdir -p /mnt/apusb
|
mkdir -p /mnt/apusb
|
||||||
|
Reference in New Issue
Block a user