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

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mods/mod_hakchi/hakchi/init')
-rw-r--r--mods/mod_hakchi/hakchi/init58
1 files changed, 28 insertions, 30 deletions
diff --git a/mods/mod_hakchi/hakchi/init b/mods/mod_hakchi/hakchi/init
index cd1ab8d2..50fc66a4 100644
--- a/mods/mod_hakchi/hakchi/init
+++ b/mods/mod_hakchi/hakchi/init
@@ -1,38 +1,36 @@
-init(){
-echo
-/bin/busybox --install -s /bin/
+#!/bin/sh
-local modname="hakchi"
-local modpath="/$modname"
-local mountpoint="/newroot"
-local installpath=""
-local firmwarepath=""
-local rootfs=""
-local squashfs=""
-local preinit=""
-local preinitpath=""
-local sftype=""
-local sfregion=""
-local gamepath=""
-local temppath="/tmp"
+init(){
+ echo
+ export modname="hakchi"
+ export modpath="/$modname"
+ export mountpoint="/newroot"
+ export temppath="/tmp"
-mkdir -p "$temppath"
+ /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"
+ source "$modpath/config"
+ source "$modpath/script/base"
-if [ -d "$modpath/transfer" ]; then
- source "$modpath/script/transfer"
-else
- mount_base
-fi
+ if [ -d "$modpath/transfer" ]; then
+ export cf_usb='n'
+ source "$modpath/script/transfer"
+ else
+ mount_base
+ fi
-if [ -f "$preinit" ]; then
- source "$preinit"
- preinit
-else
- umount_base
-fi
+ if [ -f "$preinit" ]; then
+ PATH="$rootfs/sbin:$rootfs/usr/sbin:$rootfs/bin:$rootfs/usr/bin:$PATH"
+ "$rootfs/bin/busybox" sh -c "source "$preinit.d/b0000_defines" && source "$preinit" && preinit"
+ else
+ umount_base
+ fi
}
init
+echo