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

reflash « script « hakchi « mod_hakchi « mods - github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 258d263ee40525991d4e74b7812f422927306c86 (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
umount_base

local firmware="$(find -type f -name "*.hsqs" | sort | head -n 1)"
if [ -f "$firmware" ]; then
  umount "$mountpoint"

  cryptsetup close root-crypt
  cryptsetup open /dev/nandb root-crypt --type plain --cipher aes-xts-plain --key-file /key-file

  dd if=/dev/zero of=/dev/mapper/root-crypt bs=512 "seek=$(($(stat -c%s "$firmware")/512))"
  dd "if=$firmware" of=/dev/mapper/root-crypt bs=512

  cryptsetup close root-crypt
  cryptsetup open /dev/nandb root-crypt --readonly --type plain --cipher aes-xts-plain --key-file /key-file

  mount -o ro,noatime /dev/mapper/root-crypt "$mountpoint"
fi
unset firmware

local tmk="$(pwd)/mkfs.txz"
if [ -f "$tmk"]; then
  rm "/lib"
  cd / && tar xJf "$tmk"
  mount_bind "$mountpoint/lib" "/lib"
#  /sbin/mkfs.ext4 -L data -m 0 /dev/nandc
  mkfs.ext2 -L data -m 0 /dev/nandc
  umount "/lib"
fi
unset tmk

mount_base