Skip to content

Commit

Permalink
Rebase, rework
Browse files Browse the repository at this point in the history
  • Loading branch information
HuskyDG committed Feb 4, 2023
0 parents commit 9d38ac4
Show file tree
Hide file tree
Showing 42 changed files with 3,227 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

on:
push:
branches: [ main ]
paths:
- 'initrd/**'
- '.github/workflows/build.yml'
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Build initrd-magisk
run: |
cd initrd
chmod -R 777 *; ln -fs /bin/ld-linux.so.2 lib/ld-linux.so.2; find * | cpio -o -H newc | gzip > ../initrd-magisk.img
cd ..
- uses: actions/upload-artifact@v1
with:
name: initrd-magisk
path: initrd-magisk.img
- name: Patch boot image
run: |
cd patch
sh download.sh
cp ../initrd/boot.img.gz ./boot.img.gz
cp ../initrd/magisk/magiskboot.gz ./magiskboot.gz
gzip -d ./boot.img.gz
gzip -d ./magiskboot.gz
chmod 777 ./magiskboot
sh ./boot_patch.sh boot.img canary-huskydg
sh ./boot_patch.sh boot.img debug-huskydg
cd ..
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: Boot image for initrd-magisk
path: |
boot-magisk_canary-huskydg.img
boot-magisk_debug-huskydg.img
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/

# Other files and folders
.settings/

# Executables
*.swf
*.air
*.ipa
*.apk

# others
README.md
LICENSE

# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# initrd-magisk
Another easy and convenient way to integrate Magisk, add support `boot.img` for Magisk into Android-x86 project (BlissOS, PrimeOS, ...). Check out [Wiki page](http://github.com/huskydg/initrd-magisk/wiki) for install instructions and more information.

<img src="https://i.imgur.com/1BbSrTp.jpg"/>
1 change: 1 addition & 0 deletions initrd/android/placeholder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#placeholder
Binary file added initrd/bin/busybox
Binary file not shown.
3 changes: 3 additions & 0 deletions initrd/bin/info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
initrd_magisk_ver=v1.18
MAGISKCORE=/magisk
TMPDIR=/tmp
Binary file added initrd/bin/ld-linux.so.2
Binary file not shown.
52 changes: 52 additions & 0 deletions initrd/bin/lndir
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

[ "$1" = "-v" ] && verbose=-v && shift

src=$1
dst=${2:-.}

usage()
{
echo "Usage: $(basename $0) SRC_DIR [DST_DIR]"
echo
exit 1
}

make_dir()
{
[ -d "$2" ] || mkdir -p "$2"
if [ "`id -u`" = "0" ]; then
chmod `stat -c "%a" "$1"` "$2"
chown `stat -c "%u.%g" "$1"` "$2"
fi
}

linkdir()
{
local odir="$PWD"
make_dir "$1" "$2"
[ -d "$2" ] || mkdir -p "$2"
cd "$2"
local d="$PWD"
cd "$odir" && cd "$1"
for f in * .*; do
if [ "$f" != "." -a "$f" != ".." -a \( -e "$f" -o -L "$f" \) ]; then
if [ -d "$f" -a ! -L "$f" ]; then
linkdir "$f" "$d/$f"
else
ln $verbose "$f" "$d"
fi
fi
done
cd "$odir"
}

[ -d /system/bin ] && PATH=/system/bin:$PATH

[ -z "$src" ] && usage

[ ! -d "$src" ] && echo "$src is not a directory" && exit 2

echo "$src" | grep -q /$ || dst=$dst/$(basename "$src")

linkdir "$src" "$dst"
Loading

0 comments on commit 9d38ac4

Please sign in to comment.