This commit is contained in:
tumGER 2019-03-09 21:54:21 +01:00 committed by Nichole Mattera
parent 51e9a59f2c
commit 6ceca984bb
12 changed files with 31 additions and 127 deletions

View file

@ -1,99 +0,0 @@
package main
import (
"fmt"
"io"
"io/ioutil"
"os"
"path"
)
func main() {
var modules []string
fdr, _ := ioutil.ReadDir(".")
for _, item := range fdr {
if item.IsDir() {
modules = append(modules, item.Name())
}
}
fmt.Println(`
https://github.com/AtlasNX/Kosmos
____ __.
| |/ _|____ ______ _____ ____ ______
| < / _ \/ ___// \ / _ \/ ___/
| | ( <_> )___ \| Y Y ( <_> )___ \
|____|__ \____/____ >__|_| /\____/____ >
\/ \/ \/ \/
By: @AtlasNX (AtlasNX/Kosmos on Github)`)
if _, err := os.Stat("compiled"); !os.IsNotExist(err) {
os.RemoveAll("compiled")
}
for _, item := range modules {
dir(item, "compiled")
}
}
func file(src, dst string) error {
var err error
var srcfd *os.File
var dstfd *os.File
var srcinfo os.FileInfo
if srcfd, err = os.Open(src); err != nil {
return err
}
defer srcfd.Close()
if dstfd, err = os.Create(dst); err != nil {
return err
}
defer dstfd.Close()
if _, err = io.Copy(dstfd, srcfd); err != nil {
return err
}
if srcinfo, err = os.Stat(src); err != nil {
return err
}
return os.Chmod(dst, srcinfo.Mode())
}
func dir(src string, dst string) error {
var err error
var fds []os.FileInfo
var srcinfo os.FileInfo
if srcinfo, err = os.Stat(src); err != nil {
return err
}
if err = os.MkdirAll(dst, srcinfo.Mode()); err != nil {
return err
}
if fds, err = ioutil.ReadDir(src); err != nil {
return err
}
for _, fd := range fds {
srcfp := path.Join(src, fd.Name())
dstfp := path.Join(dst, fd.Name())
if fd.IsDir() {
if err = dir(srcfp, dstfp); err != nil {
fmt.Println(err)
}
} else {
if err = file(srcfp, dstfp); err != nil {
fmt.Println(err)
}
}
}
return nil
}

View file

@ -1,40 +1,44 @@
#!/usr/bin/env python
# Merges all modules together because I'm lazy ;^)
import subprocess as sbp
import os
import shutil
import time
if os.path.exists("compiled"):
shutil.rmtree("compiled")
modules = ["appstore", "bootlogo", "edizon", "goldleaf",
"hbmenu", "hekate_payload", "must_have", "kosmosupdater",
"sys-ftpd", "sys-netcheat", "kosmos_toolkit",
"lockpick", "sd_setup"] # Everything that will be merged together
p2 = "compiled" # How the merged folder should be called
modules = [module for module in os.listdir() if os.path.isdir(module)]
def copyDir(srcDir, dstDir):
os.makedirs(dstDir, exist_ok=True)
fds = os.listdir(srcDir)
for fd in fds:
srcfp = os.path.join(srcDir, fd)
dstfp = os.path.join(dstDir, fd)
if os.path.isdir(srcfp):
copyDir(srcfp, dstfp)
else:
shutil.copy(srcfp, dstfp)
print(r"""
print("""
https://github.com/AtlasNX/Kosmos
____ __.
| |/ _|____ ______ _____ ____ ______
| < / _ \/ ___// \ / _ \/ ___/
| | ( <_> )___ \| Y Y ( <_> )___ \
|____|__ \____/____ >__|_| /\____/____ >
\/ \/ \/ \/
By: @AtlasNX (AtlasNX/Kosmos on Github)""")
os.makedirs("compiled")
By: @AtlasNX (AtlasNX/Kosmos on Github)
It could be that a permissions error will pop up, fix it by restarting the python script! We don\'t really know why that happens!
""") # Fancy stuff
if os.path.exists("compiled"):
shutil.rmtree("compiled") # Delete Content of "compiled" if it exists!
os.makedirs("compiled") # Double check
for path in modules:
copyDir(path, "compiled")
fol = os.listdir(path)
for i in fol:
p1 = os.path.join(path,i)
p3 = 'cp -r ' + p1 +' ' + p2+'/.'
sbp.Popen(p3,shell=True)
time.sleep(0.1)
print("Done!")
print("Done!")

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -8,7 +8,7 @@ backlight=100
autohosoff=0
autonogc=1
{AtlasNX/Kosmos v11.11}
{AtlasNX/Kosmos v11.11-Hekate Beta}
{ }
{Discord: discord.teamatlasnx.com}
{Github: git.teamatlasnx.com}
@ -24,8 +24,7 @@ logopath=bootloader/bootlogo.bmp
{ }
{---- Miscellaneous ---}
[Stock (1.0-6.2)]
[Stock (7.0+)]
secmon=modules/required/exosphere.bin
warmboot=modules/required/lp0fw.bin
atmosphere=1
[Stock]
fss0=atmosphere/fusee-secondary.bin
stock=1
{ }

Binary file not shown.