forked from gnuradio/gnuradio-livesdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-usb.sh
executable file
·57 lines (47 loc) · 1.01 KB
/
make-usb.sh
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
#!/bin/sh
. config/config-vars
# Format destination as FAT32
if [ -z $1 ] ; then
echo Device must be specified.
exit 1
fi
if ! [ -b $1 ] ; then
echo Filespec $1 is not a device file.
exit 1
fi
echo Using device node $1
if mount | grep -q $1 ; then
echo Device node is mounted, unmounting
sudo umount $1
fi
echo Formatting device as VFAT...
sudo mkfs.vfat -I -n GNURADIO $1 || {
echo Format failed!
exit 1
}
echo Mounting destination device...
sudo mount $1 mnt/usb || {
echo Mount failed!
}
echo Invoking Unetbootin...
sudo unetbootin rootcheck=no \
method=diskimage \
installtype=usb \
isofile=iso/$REMASTER_NAME \
targetdrive=$1 \
persistentspace=4096 || {
echo Unetbootin failed!
exit 1
}
echo Copying custom boot files...
sudo cp custom/grub/grub.cfg mnt/usb/boot/grub/ &&
sudo cp custom/grub/syslinux.cfg mnt/usb/ || {
echo Copying failed!
exit 1
}
echo Unmounting target...
sync
sudo umount mnt/usb || {
echo Unmounting failed!
exit 1
}