+++ /dev/null
-#!/bin/sh
-#
-# make_upgrade_image.sh
-#
-# Convert Tizen platform image to upgrade image
-
-# For sdb debugging
-
-sdb_debugging=1
-
-# Back up data
-backup () {
- if [ $# -lt 2 ]; then
- echo "No backup data"
- return 0
- fi
-
- echo "Back up file at $2"
- cat $2
-
- # Push data for pre-patch (works in initrd)
- local backup_path="/usr/share/upgrade/prepatch/data"
- local backup_files="$(cat $2)"
- local tmp_path=$1
-
- umount ${tmp_path}
- e2fsck -f rootfs.img
- resize2fs rootfs.img 1G
- mount rootfs.img ${tmp_path}
-
- mount system-data.img ${tmp_path}/opt
- mount user.img ${tmp_path}/opt/usr
-
- mkdir -p ${tmp_path}/$backup_path
- for file in $backup_files; do
- cp -afv ${tmp_path}/$file ${tmp_path}/$backup_path
- done
-
- sync
-
- umount -l ${tmp_path}/opt/usr
- umount -l ${tmp_path}/opt
-
- umount ${tmp_path}
- e2fsck -f rootfs.img
- resize2fs -M rootfs.img
- mount rootfs.img ${tmp_path}
-}
-
-if [ `id -u` -ne 0 ]
-then
- echo "make_upgrade_image.sh should be executed as root"
- exit
-fi
-
-if [ ! $1 ]
-then
- echo "usage: $0 [tizen-image-update(tar.gz)]"
- exit
-fi
-
-echo "Decompressing $1"
-imgs=`tar zxvf $1`
-
-tmp_root=`mktemp -d system.XXX`
-echo "Mount rootfs.img"
-mount rootfs.img ${tmp_root}
-
-cwd=`pwd`
-backup ${cwd}/${tmp_root} $2
-
-sync
-umount ${tmp_root}
-
-upgrade_img=`echo $1 | sed -e 's/\.tar\.gz//'`-upgrade.tar.gz
-echo "Compressing upgrade image ${upgrade_img}"
-
-ro_imgs=
-for img in ${imgs}; do
- if [ "${img}" != "system-data.img" ] && [ "${img}" != "user.img" ]; then
- ro_imgs="${ro_imgs} ${img}"
- fi
-done
-
-tar zcf ${upgrade_img} ${ro_imgs}
-
-echo "Remove dummies"
-rm -rf ${imgs} ${tmp_root}
-
-echo "Done"