forked from embeddedTS/linux-2.6.35.3-imx28
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_to_sd
executable file
·55 lines (49 loc) · 1.44 KB
/
install_to_sd
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
#!/bin/bash
# This function installs the boot stream named in $1
# into the device named in $2 in partition number $3.
function install_boot_stream() {
echo -e "\nInstalling boot stream $1 on $2$3..."
if [ -f ./mk_hdr.sh ]
then
mk_hdr="./mk_hdr.sh"
else
mk_hdr="mk_hdr.sh"
fi
$DEBUG $mk_hdr `sudo fdisk -lu $2 | awk '$5==53 {print $2}'` 1 > temp.bin
$DEBUG sudo dd if=temp.bin of=$2$3 ibs=512 conv=sync
$DEBUG sudo dd if=$1 of=$2$3 ibs=512 obs=512 seek=1 conv=sync
$DEBUG sync
rm temp.bin
echo -e "...finished installing boot stream on $2$3.\n"
}
if [ $# -ne 1 ] ; then
echo "Usage: $0 <device>"
echo "Where <device> is name of SD card dev node, e.g. sda, sdb, mmcblk0, etc."
exit 1
fi
if [[ $UID != 0 ]]; then
echo "Please run this script as root:"
echo "sudo $0 $*"
exit 1
fi
echo "Building external wireless modules"
cd compat-wireless-3.6.8-1/
./scripts/driver-select ts &&\
make &&\
cd -
echo "Building final bootstream"
cp arch/arm/boot/zImage imx-bootlets-src-10.12.01/ &&\
cd imx-bootlets-src-10.12.01/ &&\
make &&\
cd -
echo "Installing bootstream to SD card"
mkdir mount_point/ &&\
install_boot_stream imx-bootlets-src-10.12.01/imx28_ivt_linux.sb /dev/$1 2 &&\
mount /dev/$13 mount_point/ &&\
INSTALL_MOD_PATH=mount_point/ make modules_install &&\
cd compat-wireless-3.6.8-1 &&\
KMODPATH_ARG="INSTALL_MOD_PATH=mount_point" make install &&\
cd -
umount mount_point
rmdir mount_point
sync