-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmake_copy
More file actions
executable file
·66 lines (51 loc) · 1.69 KB
/
make_copy
File metadata and controls
executable file
·66 lines (51 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
if [ "$1" == "deploy" ]; then
USB_STICK=HVISOR_LA64
USER=$(whoami)
DEV_PATH=/media/${USER}/${USB_STICK}
echo "Copying deploy to ${DEV_PATH}/deploy"
# copy:
# @echo "Waiting for USB stick to be available..."
# @while [ ! -d "$(DEV_PATH)" ]; do \
# echo "USB stick not found at $(DEV_PATH), waiting..."; \
# sleep 2; \
# done
# @echo "USB stick found, copying files..."
# @rm -rf $(DEV_PATH)/EFI
# @mkdir -p $(DEV_PATH)/EFI/BOOT
# @dd if=BOOTLOONGARCH64.EFI of=$(DEV_PATH)/EFI/BOOT/BOOTLOONGARCH64.EFI bs=4M status=progress;
# @sync
# @echo "Unmounting USB stick"
# @umount $(DEV_PATH)
# @echo "Done"
while [ ! -d "${DEV_PATH}" ]; do
echo "USB stick not found at ${DEV_PATH}, waiting..."
sleep 2
done
echo "USB stick found, copying files..."
cp -ar ./deploy ${DEV_PATH}/
sync
echo "Done"
fi
if [ "$1" == "deploy_noext4" ]; then
USB_STICK=HVISOR_LA64
USER=$(whoami)
DEV_PATH=/media/${USER}/${USB_STICK}
echo "Copying deploy to ${DEV_PATH}/deploy and ignore ext4 files"
while [ ! -d "${DEV_PATH}" ]; do
echo "USB stick not found at ${DEV_PATH}, waiting..."
sleep 2
done
echo "USB stick found, copying files while maintaining directory structure..."
# Create deploy directory if it doesn't exist
mkdir -p ${DEV_PATH}/deploy
# Use rsync to copy files while maintaining directory structure and excluding .ext4 files
rsync -av --exclude="*.ext4" ./deploy/ ${DEV_PATH}/deploy/
sync
echo "Done"
fi
# if not set -dev flag, then copy to USB stick
if [ "$2" != "-dev" ]; then
echo "Copying to USB stick"
make -f Makefile.1 copy
fi