Welcome to mirror list, hosted at ThFree Co, Russian Federation.

transfer « script « hakchi « mod_hakchi « mods - github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 82110c8f4df48040f64c2831439abd8e00de9582 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
showImage "$modpath/rootfs/etc/$modname.fb"
source "$modpath/script/install"

backup_nandc
mount_base
backup

source "$modpath/rootfs/etc/preinit.d/p0000_config"
source_config

local transferpath="$modpath/transfer"

cd "$transferpath"
[ -f "$transferpath/earlybird" ] && source "$transferpath/earlybird"
rm -f "$transferpath/earlybird"

if [ -d "$transferpath/reflash" ]; then
  cd "$transferpath/reflash"
  source "$modpath/script/reflash"
  cd "$transferpath"
  rm -rf "$transferpath/reflash"
fi

# transfer firmware, if any
if [ -d "$transferpath/firmware" ]; then
  local firmware="$(find "$transferpath/firmware" -type f -name "*.hsqs" | sort | head -n 1)"
  if [ -f "$firmware" ]; then
    mkdir -p "$firmwarepath"
    local firmware_name="$(basename "$firmware")"
    find "$firmwarepath" -type f -not -name "$firmware_name" -delete
    echo "transferring firmware..."
    copy "$firmware" "$firmwarepath/"
    cfg_firmware="auto"
  fi
  rm -rf "$transferpath/firmware"
fi

# if we're running modified firmware, mount it now
source_parts "$modpath/rootfs/etc/preinit.d/p????_*firmware*"

# now we can do install/repair
if [ -f "$preinit" ]; then
  echo "$modname already installed"
  mod_repair
else
  mod_install
fi

[ -f "$transferpath/uninstall" ] && packs_uninstall $(cat "$transferpath/uninstall")
rm -f "$transferpath/uninstall"
[ -f "$transferpath/hmod/uninstall" ] && packs_uninstall $(cat "$transferpath/hmod/uninstall")
rm -f "$transferpath/hmod/uninstall"

packs_install "$transferpath"
if [ -d "$transferpath/hmod" ]; then
  packs_install "$transferpath/hmod"
  rm -rf "$transferpath/hmod"
fi

if [ -d "$transferpath/games" ]; then
  source "$modpath/script/games"
  transfer_games "$transferpath/games"
  rm -rf "$transferpath/games"
fi

echo "transferring data..."
transfer_path "$transferpath"
echo

save_config
[ "$cf_shutdown" == "y" ] && shutdown
[ "$cf_shutdown" == "r" ] && reboot
echo