Related
I'm trying to run scripts in recovery and running into some trouble.
Example1:
Code:
#!/sbin/sh
if [ -s /system/etc/data2sd.on ]; then echo Presemt; else echo No; fi;
Output:
Code:
sh /tmp/test.sh
Presemt
Example2:
Code:
#!/sbin/sh
if [ -s /system/etc/data2sd.on ];
then
echo Presemt;
else
echo No;
fi;
Output
Code:
sh /tmp/test.sh
: not foundh: line 7:
: not foundh: line 7:
No
: not foundh: line 7:
/tmp #
I've been trying out different spacing, and punctuation; still cannot work this out. I'm running it on a Desire. If anyone could offer some suggestions on a fix, I'd be thankful. I've got a very complex script if/else script which runs fine when run in init.d as busybox runparts. However this simple script doesnt run in recovery without errors!
droidzone said:
Example2:
Code:
#!/sbin/sh
if [ -s /system/etc/data2sd.on ] [B]# remove the ;[/B]
then
echo Presemt;
else
echo No;
fi [B]# remove the ;[/B]
Click to expand...
Click to collapse
This should work
Benee said:
This should work
Click to expand...
Click to collapse
Thanks for the reply!
But..now it gives:
Code:
cat test.sh
#!/sbin/sh
if [ -s /system/etc/data2sd.on ];
then
echo Presemt;
else
echo No;
fi
#test/tmp # sh /tmp/test.sh
sh /tmp/test.sh
[B]/tmp/test.sh: line 8: syntax error: unexpected end of file (expecting "fi")[/B]
/tmp #
Another one:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]; then cp /tmp/data2sd/*.* /system/etc/ ; echo "All backed up"; else echo "Not backing up"; fi;
The above script works perfectly.
The one below gives an error:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ];
then
cp /tmp/data2sd/*.* /system/etc/ ;
echo "All backed up" ;
else
echo "Not backing up" ;
fi ;
I'm wondering whether recovery sh does not support multiline if/else statements.
/tmp/data2sd # sh /tmp/test.sh
sh /tmp/test.sh
: not foundh: line 9:
: not foundh: line 9:
Not backing up
: not foundh: line 9:
/tmp/data2sd #
Click to expand...
Click to collapse
droidzone said:
Code:
if [ -s /system/etc/data2sd.on ] [B]No ; here[/B]
then
echo Presemt;
else
echo No;
fi
Click to expand...
Click to collapse
droidzone said:
Another one:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ] [B]No ; here[/B]
then
cp /tmp/data2sd/*.* /system/etc/ ;
echo "All backed up" ;
else
echo "Not backing up" ;
fi [B]No ; here[/B]
Click to expand...
Click to collapse
If, then, else fi lines don't end with a ; .
Benee said:
If, then, else fi lines don't end with a ; .
Click to expand...
Click to collapse
Thanks again..I've modified it as:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]
then
cp /tmp/data2sd/*.* /system/etc/ ;
echo "All backed up" ;
else
echo "Not backing up" ;
fi
This gives this error:
/tmp/data2sd # sh /tmp/test.sh
sh /tmp/test.sh
sh: missing ]
: not foundh: line 9:
Not backing up
: not foundh: line 9:
/tmp/data2sd #
Click to expand...
Click to collapse
This is weird. I cant understand why it wont run smoothly. If I put it all on one line, it runs correctly.
droidzone said:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]
then
cp /tmp/data2sd/*.* /system/etc/
echo "All backed up"
else
echo "Not backing up"
fi
Click to expand...
Click to collapse
Man I'm stupid Too early in the morning for me. No need for ; at all ...
Benee said:
Man I'm stupid Too early in the morning for me. No need for ; at all ...
Click to expand...
Click to collapse
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]
then
cp /tmp/data2sd/*.* /system/etc/
echo "All backed up"
else
echo "Not backing up"
fi
Now the error code has changed. It's still giving me the wrong output.
sh /tmp/test.sh
sh: missing ]
: not foundh: line 9:
Not backing up
~ # sh /tmp/test.sh
sh /tmp/test.sh
sh: missing ]
: not foundh: line 9:
Not backing up
~ #
Click to expand...
Click to collapse
I then put a ; after the ]
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ];
then
cp /tmp/data2sd/*.* /system/etc/
echo "All backed up"
else
echo "Not backing up"
fi
This gives:
sh /tmp/test.sh
: not foundh: line 9:
: not foundh: line 9:
Not backing up
Click to expand...
Click to collapse
droidzone said:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]
then
cp /tmp/data2sd/*.* /system/etc/
echo "All backed up"
else
echo "Not backing up"
fi
...
Click to expand...
Click to collapse
hrmm maybe some debugging trys.
Code:
if [ -s /tmp/data2sd/data2sd.on ]
then
echo "All backed up"
else
echo "Not backing up"
fi
Try this
Benee said:
hrmm maybe some debugging trys.
Code:
if [ -s /tmp/data2sd/data2sd.on ]
then
echo "All backed up"
else
echo "Not backing up"
fi
Try this
Click to expand...
Click to collapse
That gives this:
sh /tmp/test.sh
/tmp/test.sh: line 8: syntax error: unexpected "fi" (expecting "then")
Click to expand...
Click to collapse
droidzone said:
Thanks again..I've modified it as:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]
then
cp /tmp/data2sd/*.* /system/etc/ ;
echo "All backed up" ;
else
echo "Not backing up" ;
fi
Click to expand...
Click to collapse
Tangent: unless I'm mistaken, *.* will not backup everything but only files with a "." in their name. You should use 'cp /tmp/data2sd/* /system/etc/' instead.
Also, isn't it 'cp SOURCE DESTINATION' ? Do you really want to back up from /tmp/data2sd to /system/etc ?
fake edit: ah, just saw the comment . Then it should be "All restored"/"Not restoring" right ?
Code:
if [ -s /tmp/data2sd/data2sd.on ]; then
echo "All backed up"
else
echo "Not backing up"
fi
again
10 Chars
SebHTCHero said:
Tangent: unless I'm mistaken, *.* will not backup everything but only files with a "." in their name. You should use 'cp /tmp/data2sd/* /system/etc/' instead.
Also, isn't it 'cp SOURCE DESTINATION' ? Do you really want to back up from /tmp/data2sd to /system/etc ?
fake edit: ah, just saw the comment . Then it should be "All restored"/"Not restoring" right ?
Click to expand...
Click to collapse
You're right. I was kind of going along with the msdos style wildcards. But my files (data2sd.ver, data2sd.log) do have a . in between.
Yup, I'm indeed restoring from tmp. Since it was a debug, I wasnt paying attention to the echo commands. It's the second part of a script, the first part of which backs up these files to tmp before system format, and then restores them after. Unfortunately, as soon as I make it multiline, it fails with some error.
Benee said:
Code:
#!/sbin/sh
#Restore backed up Settings
if [ -s /tmp/data2sd/data2sd.on ]; then
echo "All backed up"
else
echo "Not backing up"
fi
again
10 Chars
Click to expand...
Click to collapse
Again
Code:
sh test.sh
test.sh: line 7: syntax error: unexpected "fi" (expecting "then")
droidzone said:
Again
Code:
sh test.sh
test.sh: line 7: syntax error: unexpected "fi" (expecting "then")
Click to expand...
Click to collapse
In my kernel compile script on line 63 there is a similar if. It should work. I don't know what is wrong anymore. Really strange
Compile script
Benee said:
In my kernel compile script on line 63 there is a similar if. It should work. I don't know what is wrong anymore. Really strange
Compile script
Click to expand...
Click to collapse
Thanks anyway.
I noticed that your script uses bash as the script debugger
#!/bin/bash
Could there be a difference in these two? I dont think this is it either. I saw similiar if/else script in Firerat's MTD patcher script too, and that seems to work.
Thanks a lot anyway..I'll just put the script on one big line.
droidzone said:
Thanks anyway.
I noticed that your script uses bash as the script debugger
#!/bin/bash
Could there be a difference in these two? I dont think this is it either. I saw similiar if/else script in Firerat's MTD patcher script too, and that seems to work.
Thanks a lot anyway..I'll just put the script on one big line.
Click to expand...
Click to collapse
hehe yeah... the sbin and bin shouldn't fix the problem. I can't find the error. Everything is looking good. But yeah this is a solution
What editor are you using for the multi-line script? Are you saving it in DOS format? bash won't read the \r\n from a Windows/DOS text editor at the end of lines if you're using Notepad, etc.
romracer said:
What editor are you using for the multi-line script? Are you saving it in DOS format? bash won't read the \r\n from a Windows/DOS text editor at the end of lines if you're using Notepad, etc.
Click to expand...
Click to collapse
Used Notepad++. It seems to be good enough for update-scripts.
droidzone said:
Used Notepad++. It seems to be good enough for update-scripts.
Click to expand...
Click to collapse
Maybe, but update-scripts aren't BASH scripts. BASH does care about line endings; I don't know whether Amend/Edify do or not.
Anyway, Notepad++ can save with UNIX line endings. I don't use it, but this forum post suggests you look in the options:
http://www.phpbb.com/community/viewtopic.php?f=71&t=2083365
Notepad++ > Settings > Preferences > New Document/Default Directory > Format > Unix.
Other Google searches indicate there may be a conversion option under the Edit or Format menus.
For those of you wanting to patch your device asap, you can download my patched kernel. This is built from the latest Samsung standard sources with a couple of minor config changes, namely the ability to change SELinux enforcing mode as boot and runtime, removal of DM_VERITY and KNOX_KAP and a couple of IPv6 / QoS items (netfilter targets, qdiscs). The full config diff is below.
If you want to use this kernel you will need to create your own bootimage. On your device
Code:
# dd if=/dev/block/platform/15540000.dwmmc0/by-name/BOOT of=/sdcard/boot.img
Unpack the boot image (you can use this tool. In the unpacked folder, replace the boot.img-zImage with the new zImage from the zip file you downloaded. Recreate the bootimage with the mkbootimg tool (all the command line args you need to supply will be in the files that the unpackbootimg command created - just plug these values back in).
Now you can adb push the new boot.img back to your device and flash it using the reverse operation
Code:
# dd if=/sdcard/boot.img of=/dev/block/platform/15540000.dwmmc0/by-name/BOOT
If you want to compile your own kernel, here's the patch. In the kernel source dir, do
Code:
$ git init
$ git add .
$ git commit -m "initial"
$ git apply CVE-2016-5195.patch
CVE-2016-5195.patch:
Code:
From 4ecebb23a13c366b5d46cd0a76f14e6c81dd2da7 Mon Sep 17 00:00:00 2001
From: DL <[email protected]>
Date: Tue, 25 Oct 2016 19:36:32 +0700
Subject: [PATCH] Dirtycow Patch - CVE-2016-5195
---
include/linux/mm.h | 1 +
mm/memory.c | 28 ++++++++++++++++++++++++----
2 files changed, 25 insertions(+), 4 deletions(-)
mode change 100755 => 100644 include/linux/mm.h
mode change 100755 => 100644 mm/memory.c
diff --git a/include/linux/mm.h b/include/linux/mm.h
old mode 100755
new mode 100644
index 93b01bb..979e4c7
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1711,6 +1711,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma,
#define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */
#define FOLL_NUMA 0x200 /* force NUMA hinting page fault */
#define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */
+#define FOLL_COW 0x4000 /* internal GUP flag */
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
void *data);
diff --git a/mm/memory.c b/mm/memory.c
old mode 100755
new mode 100644
index bcde4a1..5331526
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1497,6 +1497,16 @@ int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
}
EXPORT_SYMBOL_GPL(zap_vma_ptes);
+/*
+ * FOLL_FORCE can write to even unwritable pte's, but only
+ * after we've gone through a COW cycle and they are dirty.
+ */
+static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
+{
+ return pte_write(pte) ||
+ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
+}
+
/**
* follow_page_mask - look up a page descriptor from a user-virtual address
* @vma: vm_area_struct mapping @address
@@ -1604,7 +1614,7 @@ split_fallthrough:
}
if ((flags & FOLL_NUMA) && pte_numa(pte))
goto no_page;
- if ((flags & FOLL_WRITE) && !pte_write(pte))
+ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags))
goto unlock;
page = vm_normal_page(vma, address, pte);
@@ -1911,7 +1921,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
*/
if ((ret & VM_FAULT_WRITE) &&
!(vma->vm_flags & VM_WRITE))
- foll_flags &= ~FOLL_WRITE;
+ foll_flags |= FOLL_COW;
cond_resched();
}
@@ -3913,8 +3923,18 @@ retry:
if (unlikely(pmd_none(*pmd)) &&
unlikely(__pte_alloc(mm, vma, pmd, address)))
return VM_FAULT_OOM;
- /* if an huge pmd materialized from under us just retry later */
- if (unlikely(pmd_trans_huge(*pmd)))
+ /*
+ * If a huge pmd materialized under us just retry later. Use
+ * pmd_trans_unstable() instead of pmd_trans_huge() to ensure the pmd
+ * didn't become pmd_trans_huge under us and then back to pmd_none, as
+ * a result of MADV_DONTNEED running immediately after a huge pmd fault
+ * in a different thread of this mm, in turn leading to a misleading
+ * pmd_trans_huge() retval. All we have to ensure is that it is a
+ * regular pmd that we can walk with pte_offset_map() and we can do that
+ * through an atomic read in C, which is what pmd_trans_unstable()
+ * provides.
+ */
+ if (unlikely(pmd_trans_unstable(pmd)))
return 0;
/*
* A regular pmd is established and it can't morph into a huge pmd
--
1.8.3.1
diff -Naur arch/arm/configs/trelte_00_defconfig .config
Code:
--- arch/arm/configs/trelte_00_defconfig 2016-03-01 17:00:22.000000000 +0700
+++ .config 2016-10-18 19:21:17.000000000 +0700
@@ -102,7 +102,8 @@
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_BOOST is not set
# CONFIG_RCU_NOCB_CPU is not set
-# CONFIG_IKCONFIG is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=19
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
@@ -391,7 +392,7 @@
CONFIG_RKP_DBLMAP_PROT=y
CONFIG_HYP_RKP=y
CONFIG_TIMA_RKP_30=y
-CONFIG_KNOX_KAP=y
+# CONFIG_KNOX_KAP is not set
CONFIG_TIMA_RKP_L1_TABLES=y
# CONFIG_TIMA_RKP_L2_TABLES is not set
# CONFIG_TIMA_RKP_DEBUG is not set
@@ -741,9 +742,23 @@
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
-# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_ADVANCED=y
+# CONFIG_TCP_CONG_BIC is not set
CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_CONG_WESTWOOD=y
+# CONFIG_TCP_CONG_HTCP is not set
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_DEFAULT_CUBIC is not set
+CONFIG_DEFAULT_WESTWOOD=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="westwood"
# CONFIG_TCP_MD5SIG is not set
CONFIG_IPV6=y
CONFIG_IPV6_PRIVACY=y
@@ -839,7 +854,7 @@
CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
# CONFIG_NETFILTER_XT_TARGET_CT is not set
# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
-# CONFIG_NETFILTER_XT_TARGET_HL is not set
+CONFIG_NETFILTER_XT_TARGET_HL=y
# CONFIG_NETFILTER_XT_TARGET_HMARK is not set
CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
CONFIG_NETFILTER_XT_TARGET_LOG=y
@@ -948,16 +963,16 @@
CONFIG_NF_DEFRAG_IPV6=y
CONFIG_NF_CONNTRACK_IPV6=y
CONFIG_IP6_NF_IPTABLES=y
-# CONFIG_IP6_NF_MATCH_AH is not set
-# CONFIG_IP6_NF_MATCH_EUI64 is not set
-# CONFIG_IP6_NF_MATCH_FRAG is not set
-# CONFIG_IP6_NF_MATCH_OPTS is not set
-# CONFIG_IP6_NF_MATCH_HL is not set
-# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set
-# CONFIG_IP6_NF_MATCH_MH is not set
-# CONFIG_IP6_NF_MATCH_RPFILTER is not set
-# CONFIG_IP6_NF_MATCH_RT is not set
-# CONFIG_IP6_NF_TARGET_HL is not set
+CONFIG_IP6_NF_MATCH_AH=y
+CONFIG_IP6_NF_MATCH_EUI64=y
+CONFIG_IP6_NF_MATCH_FRAG=y
+CONFIG_IP6_NF_MATCH_OPTS=y
+CONFIG_IP6_NF_MATCH_HL=y
+CONFIG_IP6_NF_MATCH_IPV6HEADER=y
+CONFIG_IP6_NF_MATCH_MH=y
+CONFIG_IP6_NF_MATCH_RPFILTER=y
+CONFIG_IP6_NF_MATCH_RT=y
+CONFIG_IP6_NF_TARGET_HL=y
CONFIG_IP6_NF_FILTER=y
CONFIG_IP6_NF_TARGET_REJECT=y
CONFIG_IP6_NF_TARGET_REJECT_SKERR=y
@@ -987,39 +1002,39 @@
#
# Queueing/Scheduling
#
-# CONFIG_NET_SCH_CBQ is not set
+CONFIG_NET_SCH_CBQ=y
CONFIG_NET_SCH_HTB=y
-# CONFIG_NET_SCH_HFSC is not set
-# CONFIG_NET_SCH_PRIO is not set
+CONFIG_NET_SCH_HFSC=y
+CONFIG_NET_SCH_PRIO=y
# CONFIG_NET_SCH_MULTIQ is not set
# CONFIG_NET_SCH_RED is not set
# CONFIG_NET_SCH_SFB is not set
-# CONFIG_NET_SCH_SFQ is not set
+CONFIG_NET_SCH_SFQ=y
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_GRED is not set
-# CONFIG_NET_SCH_DSMARK is not set
+CONFIG_NET_SCH_DSMARK=y
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
# CONFIG_NET_SCH_CODEL is not set
-# CONFIG_NET_SCH_FQ_CODEL is not set
-# CONFIG_NET_SCH_INGRESS is not set
+CONFIG_NET_SCH_FQ_CODEL=y
+CONFIG_NET_SCH_INGRESS=y
# CONFIG_NET_SCH_PLUG is not set
#
# Classification
#
CONFIG_NET_CLS=y
-# CONFIG_NET_CLS_BASIC is not set
+CONFIG_NET_CLS_BASIC=y
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
-# CONFIG_NET_CLS_FW is not set
+CONFIG_NET_CLS_FW=y
CONFIG_NET_CLS_U32=y
# CONFIG_CLS_U32_PERF is not set
-# CONFIG_CLS_U32_MARK is not set
+CONFIG_CLS_U32_MARK=y
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
@@ -1036,7 +1051,7 @@
CONFIG_NET_ACT_GACT=y
# CONFIG_GACT_PROB is not set
CONFIG_NET_ACT_MIRRED=y
-# CONFIG_NET_ACT_IPT is not set
+CONFIG_NET_ACT_IPT=y
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
@@ -1438,7 +1453,6 @@
# CONFIG_BCACHE is not set
CONFIG_BLK_DEV_DM=y
# CONFIG_DM_DEBUG is not set
-CONFIG_DM_BUFIO=y
CONFIG_DM_CRYPT=y
# CONFIG_DM_SNAPSHOT is not set
# CONFIG_DM_THIN_PROVISIONING is not set
@@ -1450,7 +1464,7 @@
# CONFIG_DM_DELAY is not set
# CONFIG_DM_UEVENT is not set
# CONFIG_DM_FLAKEY is not set
-CONFIG_DM_VERITY=y
+# CONFIG_DM_VERITY is not set
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set
@@ -1467,7 +1481,7 @@
# CONFIG_EQUALIZER is not set
# CONFIG_NET_FC is not set
CONFIG_MII=y
-# CONFIG_IFB is not set
+CONFIG_IFB=y
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
@@ -4524,8 +4538,9 @@
# CONFIG_SECURITY_PATH is not set
CONFIG_LSM_MMAP_MIN_ADDR=4096
CONFIG_SECURITY_SELINUX=y
-# CONFIG_SECURITY_SELINUX_BOOTPARAM is not set
-# CONFIG_SECURITY_SELINUX_DISABLE is not set
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
+CONFIG_SECURITY_SELINUX_DISABLE=y
CONFIG_SECURITY_SELINUX_DEVELOP=y
CONFIG_SECURITY_SELINUX_AVC_STATS=y
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
Well done. Working good so far.
What sources did you use?
dicksteele said:
Well done. Working good so far.
What sources did you use?
Click to expand...
Click to collapse
He said" This is built from the latest Samsung standard source"
zealjibia said:
He said" This is built from the latest Samsung standard source"
Click to expand...
Click to collapse
I understand that. N910CXXU2DPI7 appears to be the latest. Which is why my question was simply, which one did he use, to verify that was it.
dicksteele said:
I understand that. N910CXXU2DPI7 appears to be the latest. Which is why my question was simply, which one did he use, to verify that was it.
Click to expand...
Click to collapse
Yes, correct. I used the latest vanilla Samsung sources N910CXXU2DPI7. You can download them directly from Samsung. I've supplied the patch and the config diff, so everyone can precisely replicate the linked binary kernel version if they wish.
dl12345 said:
Yes, correct. I used the latest vanilla Samsung sources N910CXXU2DPI7. You can download them directly from Samsung. I've supplied the patch and the config diff, so everyone can precisely replicate the linked binary kernel version if they wish.
Click to expand...
Click to collapse
Excellent thanks. I've downloaded and getting compile errors. But I've been on travel for the past couple of weeks and my brains is not completely functioning.
dicksteele said:
Excellent thanks. I've downloaded and getting compile errors. But I've been on travel for the past couple of weeks and my brains is not completely functioning.
Click to expand...
Click to collapse
If it helps to know, I use the android ndk 13 toolchain. Here are two files that I use, the first to setup the environment, the second to build the kernel. My NDK is installed in /opt/android/android-ndk-r13
/opt/android/setvars.sh
Code:
#!/bin/bash
NDKARCH="arm-linux-androideabi"
NDKARCHVER="4.9"
NDKVER="r13"
NDKBASE="/opt/android/android-ndk"
NDK="${NDKBASE}-${NDKVER}"
export NDKBIN="${NDK}/toolchains/${NDKARCH}-${NDKARCHVER}/prebuilt/linux-x86_64/bin"
export CROSS_COMPILE="${NDKARCH}-"
export ARCH=arm
export SUBARCH=arm
RE=".*${NDK}.*[:]*"
if [[ ! ${PATH} =~ ${RE} ]] ; then
export PATH="$PATH:${NDKBIN}"
elif [[ ${PATH} =~ ${RE} ]]; then
export PATH=$(echo $PATH | awk -F':' \
"{ \
i = 1; \
for (i = 1; i <= NF; i++) { \
if (\$i !~ /android-ndk/) printf \"%s\", \$i; \
else printf \"%s\", \"${NDKBIN}\"; \
if ( i < NF) printf \":\"; \
}; \
}")
fi
echo CROSS_COMPILE=$CROSS_COMPILE
echo PATH=$PATH
/opt/android/note4/src/kernel/build_kernel.sh
Code:
#!/bin/bash
. /opt/android/setvars.sh
export KBUILD_BUILD_USER=dl12345
export KBUILD_BUILD_HOST=xda
set -x
make -j16 ARCH=arm KBUILD_USER=$KBUILD_BUILD_USER KBUILD_BUILD_HOST=$KBUILD_BUILD_HOST $1
make ARCH=arm exynos5433-tre_eur_open_16.dtb
dl12345 said:
If it helps to know, I use the android ndk 13 toolchain. Here are two files that I use, the first to setup the environment, the second to build the kernel. My NDK is installed in /opt/android/android-ndk-r13
/opt/android/setvars.sh
Code:
#!/bin/bash
NDKARCH="arm-linux-androideabi"
NDKARCHVER="4.9"
NDKVER="r13"
NDKBASE="/opt/android/android-ndk"
NDK="${NDKBASE}-${NDKVER}"
export NDKBIN="${NDK}/toolchains/${NDKARCH}-${NDKARCHVER}/prebuilt/linux-x86_64/bin"
export CROSS_COMPILE="${NDKARCH}-"
export ARCH=arm
export SUBARCH=arm
RE=".*${NDK}.*[:]*"
if [[ ! ${PATH} =~ ${RE} ]] ; then
export PATH="$PATH:${NDKBIN}"
elif [[ ${PATH} =~ ${RE} ]]; then
export PATH=$(echo $PATH | awk -F':' \
"{ \
i = 1; \
for (i = 1; i <= NF; i++) { \
if (\$i !~ /android-ndk/) printf \"%s\", \$i; \
else printf \"%s\", \"${NDKBIN}\"; \
if ( i < NF) printf \":\"; \
}; \
}")
fi
echo CROSS_COMPILE=$CROSS_COMPILE
echo PATH=$PATH
/opt/android/note4/src/kernel/build_kernel.sh
Code:
#!/bin/bash
. /opt/android/setvars.sh
export KBUILD_BUILD_USER=dl12345
export KBUILD_BUILD_HOST=xda
set -x
make -j16 ARCH=arm KBUILD_USER=$KBUILD_BUILD_USER KBUILD_BUILD_HOST=$KBUILD_BUILD_HOST $1
make ARCH=arm exynos5433-tre_eur_open_16.dtb
Click to expand...
Click to collapse
This helps thanks a ton. I've really never attempted to compile a kernel for android. That's my last frontier.
I've done Linux over 10 years ago, I've just been content with using others.
They've all been great, but the only thing that was missing was the Revoke USB debugging authorizations on most of the custom ones.
I'd have to flash back to stock if ADB lost its mind and wouldn't recognize the phone.
Good stuff, great work. Much appreciation. Hope you stick around !
If you want to use ADB on this kernel and you're booting with SELinux in enforcing mode, you'll need to first run a terminal and execute
Code:
$ su
# setenforce 0
If you don't do this, ADB will appear not to work or even recognize the device.
When you're done, just setenforce 1 again. Of course, depending on how your ramdisk is setup, this may not be necessary but it's worth knowing if you run into apparent problems with ADB.
dl12345 said:
If you want to use ADB on this kernel and you're booting with SELinux in enforcing mode, you'll need to first run a terminal and execute
Code:
$ su
# setenforce 0
If you don't do this, ADB will appear not to work or even recognize the device.
When you're done, just setenforce 1 again. Of course, depending on how your ramdisk is setup, this may not be necessary but it's worth knowing if you run into apparent problems with ADB.
Click to expand...
Click to collapse
ADB usually works fine. After reflashing and moving to a new machine ADBKeys is usually hosed.
So Revoke USB debugging authorizations is not under Developer Options to reset under some kernels, but it is under stock and it was after I applied yours. Which was cool.
It doesn't happen a lot just enough to be annoying.
This is nice.. @dl12345 I suggest make a flashable kernel..
Im not seeing any updated kernel right now specially for n910c device,.. no more kernel devs
radz_ said:
This is nice.. @dl12345 I suggest make a flashable kernel..
Im not seeing any updated kernel right now specially for n910c device,.. no more kernel devs
Click to expand...
Click to collapse
[KERNEL][PI7 v1.5][6.0.1][TW] talexop - Note4 N910C Permissive
N910C_PI7_6.0.1_talexop_v1.5.zip
Came out Nov 2
Hoping sources will be out soon
The thing with a flashable kernel is that everyone has a different ramdisk, so making something that fits all sizes is tricky. I figured it better to just let people use their existing ramdisk and so they won't notice any real change, regardless of the ROM they're using.
dl12345 said:
The thing with a flashable kernel is that everyone has a different ramdisk, so making something that fits all sizes is tricky. I figured it better to just let people use their existing ramdisk and so they won't notice any real change, regardless of the ROM they're using.
Click to expand...
Click to collapse
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
radz_ said:
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
Click to expand...
Click to collapse
Flashed the talexop kernel, then the system mode supersu. Both worked fine together
radz_ said:
I saw your post in talexop's thread... are you able to confirm if dm verity is disabled with Permissive?
Im not really satisfied with systemless root, i want system mode root.. but it requires custom kernel with dm verity disabled.
http://forum.xda-developers.com/app...LX5SBEoShv5AasiQg&sig2=4Ak_z3p5coQU3YK0NY8aYw
Click to expand...
Click to collapse
Yes, CONFIG_DM_VERITY is disabled on this kernel as is CONFIG_KNOX_KAP. I run this kernel in enforcing mode (you can switch SELinux on or off with a boot command line parameter, or with the setenforce command).
dicksteele said:
Flashed the talexop kernel, then the system mode supersu. Both worked fine together
Click to expand...
Click to collapse
Oh nice... thanks for the confirmation mate.
For now I went back to stock, talexop kernel has wifi issue.. hoping for a fix soon..
radz_ said:
Oh nice... thanks for the confirmation mate.
For now I went back to stock, talexop kernel has wifi issue.. hoping for a fix soon..
Click to expand...
Click to collapse
I compiled a kernel and mine is doing the same thing. But I think I found the fix. I hope. Kernel's running good I think.
But it's my first one ever and I'm still tickering with things.
It will be 70-80% stock. IF I release it it won't be until the end of the month at least.
dicksteele said:
I compiled a kernel and mine is doing the same thing. But I think I found the fix. I hope. Kernel's running good I think.
But it's my first one ever and I'm still tickering with things.
It will be 70-80% stock. IF I release it it won't be until the end of the month at least.
Click to expand...
Click to collapse
These are all ramdisk related problems, and one of the reasons I just posted a link to a kernel rather than full boot image.
This wifi issue is a known problem caused by using secure_storage with a custom kernel or ROM. Your default.prop in your ramdisk should turn off securestorage
Code:
ro.securestorage.support=false
I'd also suggest the following edits in default.prop which are related to adb. Just search them here on XDA. There's lots of info
Code:
ro.secure=0
persist.service.adb.enable=1
persist.service.debuggable=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp,adb
dl12345 said:
Yes, CONFIG_DM_VERITY is disabled on this kernel as is CONFIG_KNOX_KAP. I run this kernel in enforcing mode (you can switch SELinux on or off with a boot command line parameter, or with the setenforce command).
Click to expand...
Click to collapse
I do not think you can change to enforcing... It is only permissive. Are you sure it changed?
---------- Post added at 10:47 ---------- Previous post was at 10:45 ----------
dl12345 said:
These are all ramdisk related problems, and one of the reasons I just posted a link to a kernel rather than full boot image.
This wifi issue is a known problem caused by using secure_storage with a custom kernel or ROM. Your default.prop in your ramdisk should turn off securestorage
Code:
ro.securestorage.support=false
I'd also suggest the following edits in default.prop which are related to adb. Just search them here on XDA. There's lots of info
Code:
ro.secure=0
persist.service.adb.enable=1
persist.service.debuggable=1
ro.debuggable=1
ro.adb.secure=0
persist.sys.usb.config=mtp,adb
Click to expand...
Click to collapse
Bump
I'm trying to understand why using echo command in sh file doesn't work in recovery.
I've made a flashable zip with 7-zip, it contains a shell script.
The updater-script is
Code:
ui_print("");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0777, "/tmp/test.sh");
run_program("/tmp/test.sh");
delete_recursive("/tmp");
unmount("/system");
unmount("/data");
and my test.sh is like this :
Code:
#!/sbin/sh
rm -rf /system/app/YouTube
echo "Delete Youtube"
test.sh deletes Youtube folder but echo command doesn't work.
I use TWRP 3.2.3.0 recovery
Echo is a command for windows command line. In recovery you use: ui_print("<message goes here");
In recovery the language used is called Edify.
Read a bit about it here:
https://forum.xda-developers.com/wiki/Edify_script_language
joluke said:
Echo is a command for windows command line. In recovery you use: ui_print("<message goes here");
In recovery the language used is called Edify.
Read a bit about it here:
https://forum.xda-developers.com/wiki/Edify_script_language
Click to expand...
Click to collapse
you use ui_print in updater-script ?
but in sh file how to print on screen if echo doesn't work in recovery ?
kramer04 said:
you use ui_print in updater-script ?
but in sh file how to print on screen if echo doesn't work in recovery ?
Click to expand...
Click to collapse
Sh use the commands you use in linux
And yes ui_print is for updater-script
joluke said:
Sh use the commands you use in linux
And yes ui_print is for updater-script
Click to expand...
Click to collapse
Ok trying to use echo in sh file doesn't work for me.
So I don't understand how to do .
Any suggestions?
kramer04 said:
Ok trying to use echo in sh file doesn't work for me.
So I don't understand how to do .
Any suggestions?
Click to expand...
Click to collapse
Use Linux commands only. Echo is for Windows command line.
I don't have the skills to help you but googling "Linux commands for console" should help
joluke said:
Use Linux commands only. Echo is for Windows command line.
I don't have the skills to help you but googling "Linux commands for console" should help
Click to expand...
Click to collapse
So googling linus commands but I don't find how to use echo in a sh file in recovery.
If you have time try yourself echo command .
I've no idea why it doesn't work.
ECHO is a command for windows command line dude! Why do you insist on using echo? Echo is for windows command line? Got it now?
You need to use other commands according to the system you are using. and in android you use bash language on .sh files!
joluke said:
ECHO is a command for windows command line dude! Why do you insist on using echo? Echo is for windows command line? Got it now?
You need to use other commands according to the system you are using. and in android you use bash language on .sh files!
Click to expand...
Click to collapse
but i don't understand why it doesn't work
else i don't know how to replace echo by an other command
Thanks for help
kramer04 said:
but i don't understand why it doesn't work
else i don't know how to replace echo by an other command
Thanks for help
Click to expand...
Click to collapse
Every programming language uses its own commands...
Maybe because of that?
After some research
i change a little my script to see if command echo works
code in updater-script
Code:
ui_print("*************************");
ui_print("sh10");
ui_print("*************************");
unmount("/system");
unmount("/data");
#ui_print("-- Montage partitions...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0777, "/tmp/test.sh");
run_program("/tmp/test.sh");
#ui_print("Extracting files ...");
#package_extract_dir("system", "/tmp/update");
#set_perm(0, 0, 0755, "/tmp/update/myscript.sh");
#run_program("/tmp/update/myscript.sh");
#delete_recursive("/tmp*");
ui_print("END OF PROCESS");
ui_print("*************************");
unmount("/data");
unmount("/system");
code in test.sh file
Code:
#!/sbin/sh
#echo on
#function to display commands
exe() { echo "\$ [email protected]" ; "[email protected]" ; }
OUTFD=$2
ui_print() {
if [ $OUTFD != "" ]; then
echo "ui_print ${1} " 1>&$OUTFD;
echo "ui_print " 1>&$OUTFD;
else
echo "${1}";
fi;
}
#rm -rf /system/app/YouTube
echo "hello world !, using echo" >tong.txt
exe echo "Delete YouTube, using exe echo"
echo "Delete YouTube, using echo" >>tong.txt
printf "hello world, using printf" >>tong.txt
cat tong.txt
ui_print "hello world! using ui_print"
echo command doesn't print on screen but it creates tong.txt and pass in results.
We can see it works in recovery.log
I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
Iperation_start: 'Flashing'
Installing zip file '/external_sd/Custom Rom/test.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Zip does not contain SELinux file_contexts file in its root.
I:has_legacy_properties: Found legacy property match!
I:Legacy property environment initialized.
*************************
sh10
*************************
unmount of /system failed; no such volume
about to run program [/sbin/busybox] with 3 args
about to run program [/sbin/busybox] with 3 args
minzip: Extracted file "/tmp/test.sh"
about to run program [/tmp/test.sh] with 1 args
$ echo Delete YouTube, using exe echo
Delete YouTube, using exe echo
hello world !, using echo
Delete YouTube, using echo
hello world, using printfsh: : unknown operand
hello world! using ui_print
END OF PROCESS
*************************
script result was [/system]
I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 0 second(s).
Updating partition details...
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
Someone has an idea why echo doesn't print on screen in TWRP recovery; else it works...
weird for me
kramer04 said:
After some research
i change a little my script to see if command echo works
code in updater-script
Code:
ui_print("*************************");
ui_print("sh10");
ui_print("*************************");
unmount("/system");
unmount("/data");
#ui_print("-- Montage partitions...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("test", "/tmp");
set_perm(0, 0, 0777, "/tmp/test.sh");
run_program("/tmp/test.sh");
#ui_print("Extracting files ...");
#package_extract_dir("system", "/tmp/update");
#set_perm(0, 0, 0755, "/tmp/update/myscript.sh");
#run_program("/tmp/update/myscript.sh");
#delete_recursive("/tmp*");
ui_print("END OF PROCESS");
ui_print("*************************");
unmount("/data");
unmount("/system");
code in test.sh file
Code:
#!/sbin/sh
#echo on
#function to display commands
exe() { echo "\$ [email protected]" ; "[email protected]" ; }
OUTFD=$2
ui_print() {
if [ $OUTFD != "" ]; then
echo "ui_print ${1} " 1>&$OUTFD;
echo "ui_print " 1>&$OUTFD;
else
echo "${1}";
fi;
}
#rm -rf /system/app/YouTube
echo "hello world !, using echo" >tong.txt
exe echo "Delete YouTube, using exe echo"
echo "Delete YouTube, using echo" >>tong.txt
printf "hello world, using printf" >>tong.txt
cat tong.txt
ui_print "hello world! using ui_print"
echo command doesn't print on screen but it creates tong.txt and pass in results.
We can see it works in recovery.log
I:Set page: 'install'
I:Set page: 'flash_confirm'
I:Set page: 'flash_zip'
Iperation_start: 'Flashing'
Installing zip file '/external_sd/Custom Rom/test.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found
I:Update binary zip
Verifying package compatibility...
Package doesn't contain compatibility.zip entry
I:Zip does not contain SELinux file_contexts file in its root.
I:has_legacy_properties: Found legacy property match!
I:Legacy property environment initialized.
*************************
sh10
*************************
unmount of /system failed; no such volume
about to run program [/sbin/busybox] with 3 args
about to run program [/sbin/busybox] with 3 args
minzip: Extracted file "/tmp/test.sh"
about to run program [/tmp/test.sh] with 1 args
$ echo Delete YouTube, using exe echo
Delete YouTube, using exe echo
hello world !, using echo
Delete YouTube, using echo
hello world, using printfsh: : unknown operand
hello world! using ui_print
END OF PROCESS
*************************
script result was [/system]
I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 0 second(s).
Updating partition details...
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
Someone has an idea why echo doesn't print on screen in TWRP recovery; else it works...
weird for me
Click to expand...
Click to collapse
You are probably going to have to go in a little different direction. See this thread where update-binary is used in place of update-script.
Tulsadiver said:
You are probably going to have to go in a little different direction. See this thread where update-binary is used in place of update-script.
Click to expand...
Click to collapse
Thanks for your answer but could you add the link
kramer04 said:
Thanks for your answer but could you add the link
Click to expand...
Click to collapse
Sorry, lol!
https://forum.xda-developers.com/an...-complete-shell-script-flashable-zip-t2934449
Tulsadiver said:
Sorry, lol!
https://forum.xda-developers.com/an...-complete-shell-script-flashable-zip-t2934449
Click to expand...
Click to collapse
Thanks, but this isn't exactly what i'm looking for even if it's very interesting.
I would like to know how to display on recovery screen
I tryed with echo command but it doesn't work
For example running this script in sh file on recovery TWRP
Code:
#!/sbin/sh
csc_id=`cat /efs/imei/mps_code.dat`
echo "==== Your active csc is $csc_id ====="
echo do displays this
==== Your active csc is BTU ====
on recovery screen
but not displays anything.
Is there a way to activate it ?
kramer04 said:
Thanks, but this isn't exactly what i'm looking for even if it's very interesting.
I would like to know how to display on recovery screen
I tryed with echo command but it doesn't work
For example running this script in sh file on recovery TWRP
Code:
#!/sbin/sh
csc_id=`cat /efs/imei/mps_code.dat`
echo "==== Your active csc is $csc_id ====="
echo do displays this
==== Your active csc is BTU ====
on recovery screen
but not displays anything.
Is there a way to activate it ?
Click to expand...
Click to collapse
Echo has never worked on my phones. ui_print works on my pixel and pixel 2. It stopped working on my pixel 3 XL but that is because I haven't found a way to mount system using toybox. Pixel 3 XL won't mount using BusyBox.
Tulsadiver said:
Echo has never worked on my phones. ui_print works on my pixel and pixel 2. It stopped working on my pixel 3 XL but that is because I haven't found a way to mount system using toybox. Pixel 3 XL won't mount using BusyBox.
Click to expand...
Click to collapse
I know echo works because i see it in recovery log but it doesn't display anything on recovery screen
And i don't understand why;
Maybe it's because of recovery ?
I use TWRP
kramer04 said:
I know echo works because i see it in recovery log but it doesn't display anything on recovery screen
And i don't understand why;
Maybe it's because of recovery ?
I use TWRP
Click to expand...
Click to collapse
Most everyone uses TWRP. I believe for recovery screen, echo must be passed on to ui_print. Try this for an explanation:
https://forum.xda-developers.com/showthread.php?t=1023150&page=1
Tulsadiver said:
Most everyone uses TWRP. I believe for recovery screen, echo must be passed on to ui_print. Try this for an explanation:
https://forum.xda-developers.com/showthread.php?t=1023150&page=1
Click to expand...
Click to collapse
yes. totaly true
finaly i resolved my problem using code from Chainfire
Code:
#!/sbin/sh
OUTFD=1
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in `ls /proc/$$/fd`; do
readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
if [ "$?" -eq "0" ]; then
ps | grep " 3 $FD " | grep -v grep >/dev/null
if [ "$?" -eq "0" ]; then
OUTFD=$FD
break
fi
fi
done
fi
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
Thanks to all
https://forum.xda-developers.com/android/software-hacking/dev-complete-shell-script-flashable-zip-t2934449/page37
kramer04 said:
yes. totaly true
finaly i resolved my problem using code from Chainfire
Code:
#!/sbin/sh
OUTFD=1
readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null
if [ "$?" -eq "0" ]; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in `ls /proc/$$/fd`; do
readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null
if [ "$?" -eq "0" ]; then
ps | grep " 3 $FD " | grep -v grep >/dev/null
if [ "$?" -eq "0" ]; then
OUTFD=$FD
break
fi
fi
done
fi
ui_print() {
echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD
}
Thanks to all
https://forum.xda-developers.com/android/software-hacking/dev-complete-shell-script-flashable-zip-t2934449/page37
Click to expand...
Click to collapse
That works on my pixel and pixel 2 but not my pixel 3 XL. But on my pixel 3 XL I also have to use toybox to mount instead of BusyBox
run_program("/sbin/toybox", "mount", "/system");
Hi
I am evaluating SM-S908E_12_Opensource provided by Samsung opensource site
The parameters in the build.sh provided by the opensource configure the vendor_dlkm.img to EXT4.
However, the original firmware's vendor_dlkm.img is F2FS
Could someone advise what are the modifications need to be made in the build.sh to configure the vendor_dlkm to F2FS
The following is code snipplet of build.sh:
:
local vendor_dlkm_props_file
if [ -z "${VENDOR_DLKM_PROPS}" ]; then
vendor_dlkm_props_file="$(mktemp)"
echo -e "vendor_dlkm_fs_type=ext4\n" >> ${vendor_dlkm_props_file}
echo -e "use_dynamic_partition_size=true\n" >> ${vendor_dlkm_props_file}
echo -e "ext_mkuserimg=mkuserimg_mke2fs\n" >> ${vendor_dlkm_props_file}
echo -e "ext4_share_dup_blocks=true\n" >> ${vendor_dlkm_props_file}
else
vendor_dlkm_props_file="${VENDOR_DLKM_PROPS}"
if [[ -f "${ROOT_DIR}/${vendor_dlkm_props_file}" ]]; then
vendor_dlkm_props_file="${ROOT_DIR}/${vendor_dlkm_props_file}"
elif [[ "${vendor_dlkm_props_file}" != /* ]]; then
echo "VENDOR_DLKM_PROPS must be an absolute path or relative to ${ROOT_DIR}: ${vendor_dlkm_props_file}"
exit 1
:
:
I had tried to amending vendor_dlkm_fs_type=f2fs which end the build with the following error:
:
extra/test/mmrm_test_module.ko
========================================================
Trimming unused modules
2022-07-15 08:00:53 - build_image.py - ERROR : Failed to build /home/cara/Downloads/SM-S908E_12_Opensource/K2/Kernel/out/msm-waipio-waipio-gki/dist/vendor_dlkm.img from /home/cara/Downloads/SM-S908E_12_Opensource/K2/Kernel/out/msm-waipio-waipio-gki/staging/vendor_dlkm_staging
:
KeyError: 'partition_size'
Could someone advise what are the modifications need to be made in the build.sh to configure the vendor_dlkm to F2FS
Thanks
regards
MHC
Hi guys i have samsung G610F (on7xelte) with orange fox recovery. There is a PassReset.zip in the recovery files, my friend forgot own phone's password (his device is Samsung Galaxy E5) if i sent my PassReset.zip to him can he use it with TWRP?
Yes, it works whit Generic Device/Other.
PassReset download:https://androidfilehost.com/?fid=10763459528675595185
PassReset.zip
update-binary:
#!/sbin/sh
OUTFD=$2
SDAT=/data/system
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
ui_print "- OrangeFox Recovery Project"
ui_print "- Delete ROM password/screen lock"
ui_print "- Author: DarthJabba9"
ui_print "- Mounting filesystems..."
mount /data
ui_print "- Processing..."
rm -f $SDAT/gatekeeper*.key
rm -f $SDAT/locksettings*
rm -f $SDAT/password.key
rm -f $SDAT/gesture.key
ui_print "- Unmounting filesystems..."
umount /data
ui_print "- Finished !"
exit 0
Presumably it will work if your friend uses OrangeFox.
ze7zez said:
PassReset.zip
update-binary:
#!/sbin/sh
OUTFD=$2
SDAT=/data/system
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
ui_print "- OrangeFox Recovery Project"
ui_print "- Delete ROM password/screen lock"
ui_print "- Author: DarthJabba9"
ui_print "- Mounting filesystems..."
mount /data
ui_print "- Processing..."
rm -f $SDAT/gatekeeper*.key
rm -f $SDAT/locksettings*
rm -f $SDAT/password.key
rm -f $SDAT/gesture.key
ui_print "- Unmounting filesystems..."
umount /data
ui_print "- Finished !"
exit 0
Presumably it will work if your friend uses OrangeFox.
Click to expand...
Click to collapse
No orange fox release for galaxy e5
Topo's said:
Yes, it works whit Generic Device/Other.
PassReset download:https://androidfilehost.com/?fid=10763459528675595185
Click to expand...
Click to collapse
I will try this i will notify if it works
CrossyAtom46 said:
No orange fox release for galaxy e5
Click to expand...
Click to collapse
Here you have the TWRP version:
[GUIDE][TWRP-zip] Remove all locksettings from lockscreen
This is mostly common knowlegde by many users and already explained in another topic but in the last couple of days i needed to help some guys with a lockscreen problem like wrong PIN, pattern or password for whatever reason it started. Instead...
forum.xda-developers.com