Fix post ota scripts

This commit is contained in:
topjohnwu 2019-01-13 13:08:39 -05:00
parent 4ff70aefac
commit 7b9a45f1a8
2 changed files with 2 additions and 2 deletions

View File

@ -285,7 +285,7 @@ public abstract class MagiskInstaller {
} }
protected boolean postOTA() { protected boolean postOTA() {
SuFile bootctl = new SuFile(Const.MAGISK_PATH + "/.core/bootctl"); SuFile bootctl = new SuFile("/data/adb/bootctl");
try (InputStream in = App.self.getResources().openRawResource(R.raw.bootctl); try (InputStream in = App.self.getResources().openRawResource(R.raw.bootctl);
OutputStream out = new SuFileOutputStream(bootctl)) { OutputStream out = new SuFileOutputStream(bootctl)) {
ShellUtils.pump(in, out); ShellUtils.pump(in, out);

View File

@ -66,7 +66,7 @@ post_ota() {
./bootctl hal-info || return ./bootctl hal-info || return
[ `./bootctl get-current-slot` -eq 0 ] && SLOT_NUM=1 || SLOT_NUM=0 [ `./bootctl get-current-slot` -eq 0 ] && SLOT_NUM=1 || SLOT_NUM=0
./bootctl set-active-boot-slot $SLOT_NUM ./bootctl set-active-boot-slot $SLOT_NUM
echo '${0%/*}/../bootctl mark-boot-successful;rm -f ${0%/*}/../bootctl $0' > post-fs-data.d/post_ota.sh echo "BCTRL=${1}/bootctl;\$BCTRL mark-boot-successful;rm -f \$BCTRL \$0" > post-fs-data.d/post_ota.sh
chmod 755 post-fs-data.d/post_ota.sh chmod 755 post-fs-data.d/post_ota.sh
cd / cd /
} }