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

init « hakchi « mod_hakchi « mods - github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e9a5db03f63d7f40185749241fe6eb94072673a (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
#!/bin/sh

init(){
  echo
  export modname="hakchi"
  export modpath="/$modname"
  export mountpoint="/newroot"
  export temppath="/tmp"
  export bootVersion="1.0.1"
  echo "$modname init script version: $bootVersion"

  /bin/busybox --install -s /bin/
  mkdir -p "$temppath"
  for dir in etc lib usr; do
    [ -e "/$dir" ] || ln -s "$mountpoint/$dir" "/$dir"
  done
  export PATH="/sbin:$modpath/rootfs/bin:/bin:$mountpoint/sbin:/usr/sbin:$mountpoint/bin:/usr/bin"

  source "$modpath/config"
  source "$modpath/script/base"

  if [ -d "$modpath/transfer" ]; then
    source "$modpath/script/transfer"
  else
    mount_base
  fi

  if [ -f "$preinit" ]; then
    export preinit
    PATH="$rootfs/sbin:$rootfs/usr/sbin:$rootfs/bin:$rootfs/usr/bin:$PATH"
    "$rootfs/bin/busybox" sh -c "source "$preinit" && preinit"
  else
    umount_base
  fi
}

init
echo