Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
4fd04e62
Commit
4fd04e62
authored
Sep 24, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove compressed ramdisk support
It is causing more issues than it addresses
parent
63a9a7d6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
30 deletions
+3
-30
Android.mk
native/jni/Android.mk
+2
-1
init.cpp
native/jni/init/init.cpp
+0
-21
Android.mk
native/jni/utils/Android.mk
+0
-1
util_functions.sh
scripts/util_functions.sh
+1
-7
No files found.
native/jni/Android.mk
View file @
4fd04e62
...
@@ -90,7 +90,8 @@ LOCAL_SRC_FILES := \
...
@@ -90,7 +90,8 @@ LOCAL_SRC_FILES := \
magiskboot/format.cpp \
magiskboot/format.cpp \
magiskboot/dtb.cpp \
magiskboot/dtb.cpp \
magiskboot/ramdisk.cpp \
magiskboot/ramdisk.cpp \
magiskboot/pattern.cpp
magiskboot/pattern.cpp \
utils/cpio.cpp
LOCAL_LDLIBS := -lz
LOCAL_LDLIBS := -lz
LOCAL_LDFLAGS := -static
LOCAL_LDFLAGS := -static
...
...
native/jni/init/init.cpp
View file @
4fd04e62
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
#include <xz.h>
#include <xz.h>
#include <magisk.hpp>
#include <magisk.hpp>
#include <cpio.hpp>
#include <utils.hpp>
#include <utils.hpp>
#include "binaries.h"
#include "binaries.h"
...
@@ -102,25 +101,6 @@ static bool unxz(int fd, const uint8_t *buf, size_t size) {
...
@@ -102,25 +101,6 @@ static bool unxz(int fd, const uint8_t *buf, size_t size) {
return
true
;
return
true
;
}
}
static
void
decompress_ramdisk
()
{
constexpr
char
tmp
[]
=
"tmp.cpio"
;
constexpr
char
ramdisk_xz
[]
=
"ramdisk.cpio.xz"
;
if
(
access
(
ramdisk_xz
,
F_OK
))
return
;
LOGD
(
"Decompressing ramdisk from %s
\n
"
,
ramdisk_xz
);
uint8_t
*
buf
;
size_t
sz
;
mmap_ro
(
ramdisk_xz
,
buf
,
sz
);
int
fd
=
xopen
(
tmp
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_CLOEXEC
,
0644
);
unxz
(
fd
,
buf
,
sz
);
munmap
(
buf
,
sz
);
close
(
fd
);
cpio_mmap
cpio
(
tmp
);
cpio
.
extract
();
unlink
(
tmp
);
unlink
(
ramdisk_xz
);
}
int
dump_magisk
(
const
char
*
path
,
mode_t
mode
)
{
int
dump_magisk
(
const
char
*
path
,
mode_t
mode
)
{
int
fd
=
xopen
(
path
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_CLOEXEC
,
mode
);
int
fd
=
xopen
(
path
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
|
O_CLOEXEC
,
mode
);
if
(
fd
<
0
)
if
(
fd
<
0
)
...
@@ -236,7 +216,6 @@ int main(int argc, char *argv[]) {
...
@@ -236,7 +216,6 @@ int main(int argc, char *argv[]) {
else
else
init
=
new
SARInit
(
argv
,
&
cmd
);
init
=
new
SARInit
(
argv
,
&
cmd
);
}
else
{
}
else
{
decompress_ramdisk
();
if
(
cmd
.
force_normal_boot
)
if
(
cmd
.
force_normal_boot
)
init
=
new
FirstStageInit
(
argv
,
&
cmd
);
init
=
new
FirstStageInit
(
argv
,
&
cmd
);
else
if
(
access
(
"/sbin/recovery"
,
F_OK
)
==
0
||
access
(
"/system/bin/recovery"
,
F_OK
)
==
0
)
else
if
(
access
(
"/sbin/recovery"
,
F_OK
)
==
0
||
access
(
"/system/bin/recovery"
,
F_OK
)
==
0
)
...
...
native/jni/utils/Android.mk
View file @
4fd04e62
...
@@ -11,7 +11,6 @@ LOCAL_SRC_FILES := \
...
@@ -11,7 +11,6 @@ LOCAL_SRC_FILES := \
misc.cpp \
misc.cpp \
selinux.cpp \
selinux.cpp \
logging.cpp \
logging.cpp \
cpio.cpp \
xwrap.cpp \
xwrap.cpp \
stream.cpp
stream.cpp
...
...
scripts/util_functions.sh
View file @
4fd04e62
...
@@ -447,13 +447,7 @@ install_magisk() {
...
@@ -447,13 +447,7 @@ install_magisk() {
# Restore the original boot partition path
# Restore the original boot partition path
[
"
$BOOTNAND
"
]
&&
BOOTIMAGE
=
$BOOTNAND
[
"
$BOOTNAND
"
]
&&
BOOTIMAGE
=
$BOOTNAND
flash_image new-boot.img
"
$BOOTIMAGE
"
||
abort
"! Insufficient partition size"
if
!
flash_image new-boot.img
"
$BOOTIMAGE
"
;
then
ui_print
"- Compressing ramdisk to fit in partition"
./magiskboot cpio ramdisk.cpio compress
./magiskboot repack
"
$BOOTIMAGE
"
flash_image new-boot.img
"
$BOOTIMAGE
"
||
abort
"! Insufficient partition size"
fi
./magiskboot cleanup
./magiskboot cleanup
rm
-f
new-boot.img
rm
-f
new-boot.img
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment