summaryrefslogtreecommitdiff
path: root/upgrade/update.sh
blob: 641500c954d3286143b13498f0d15a49c9bd050d (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
#!/bin/sh
#
# RW update script
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin

PATCH_DIR=/usr/share/upgrade/scripts
RESULT_FILE=/upgrade_result
RUN=/bin/sh

# Change to normal mode from next booting
rm /system-update
rm /usr/lib/udev/rules.d/99-sdb-switch.rules

# Execute update scripts
if [ ! -d ${PATCH_DIR} ]
then
	echo "FAIL: Upgrade directory does not exist" > ${RESULT_FILE}
else
	PATCHES=`/bin/ls ${PATCH_DIR}`

	for PATCH in ${PATCHES}; do
		${RUN} ${PATCH_DIR}/${PATCH}
	done

	${RUN} /usr/share/upgrade/update-post.sh

	sync

	echo "SUCCESS: Upgrade successfully finished" > ${RESULT_FILE}
fi

# Reboot
reboot -f