1
0
mirror of https://github.com/sgmarz/osblog.git synced 2024-11-23 18:06:20 +04:00
osblog/risc_v/userspace/upload.sh

22 lines
333 B
Bash
Raw Permalink Normal View History

#!/bin/sh
if [ $# -ne 1 ]; then
echo "You provied $# parameters, need 1"
exit 1
fi
if [ ! -r $1 ]; then
echo "Unknown file $1"
exit 2
fi
if [ $UID -ne 0 ]; then
echo "You are not running as root, this might not work."
fi
losetup /dev/loop0 ../hdd.dsk
mount /dev/loop0 /mnt
cp $1 /mnt
umount /dev/loop0
losetup -d /dev/loop0