summaryrefslogtreecommitdiff
path: root/package/adkinstall/src/adkinstall.rb4xx
blob: afaea0c39c2d49eadb02e6f92194f227bf05fa21 (plain)
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
#!/bin/sh
# installs a rootfs tar archive from OpenADK onto a NAND device
# special script for routerboard rb4xx

if [ -z $1 ];then
        printf "Please give your root tar archive as parameter\n"
        exit 1
fi

printf "Preparing mountpoints\n"
mount -t yaffs2 /dev/mtdblock2 /mnt
rm -rf /mnt/* >/dev/null 2>&1
mkdir /mnt/boot
mount -t yaffs2 /dev/mtdblock1 /mnt/boot

printf "Extracting install archive\n"
tar -C /mnt -xzpf $1
if [ $? -ne 0 ];then
	printf "Extracting of install archive failed"
	exit 1
fi

chmod 1777 /mnt/tmp
chmod 4755 /mnt/bin/busybox

sync
umount /mnt/boot
umount /mnt
if [ $? -ne 0 ];then
	printf "Unmounting filesystem failed"
	exit 1
else
	printf "Successfully installed.\n"
	exit 0
fi