Launch a script at boot VIM3L (Android)

Which system do you use? Android, Ubuntu, OOWOW or others?

Android9 Pie 64

Which version of system do you use? Please provide the version of the system here:

vim3l-android-9-64bit-v241107.img

Please describe your issue below:

I need to run a script when the device starts. I found these instructions.

> $ adb root
> $ adb remount
> $ adb push userinit.sh /system/etc/init.d/userinit
> $ adb shell vi /system/bin/preinstall.sh
> $ adb sync 
> $ adb reboot

but my FS does not have an init.d folder

instructions with init.rc don’t work also…

(1)mount -o remount,rw /
(2)vi /init.rc
(3)add a service like this in the last line:
service myshell /data/my/myshell.sh
class main
user root
group root
oneshot
(4)save scucess

what are the correct instructions?

The following post will be helpful to you

unfortunately, NO…
this thread did NOT help me at all.
there are many mentions of folders.
device/khadas
system/core/rootdir/init.rc
but I DON’T have them.
no core, no device.

kvim3l:/ # ls -la
total 2140
drwxr-xr-x  20 root   root      4096 2008-12-31 16:00 .
drwxr-xr-x  20 root   root      4096 2008-12-31 16:00 ..
dr-xr-xr-x  48 root   root         0 2011-01-01 12:00 acct
lrw-r--r--   1 root   root        11 2008-12-31 16:00 bin -> /system/bin
drwxr-xr-x   2 root   root      4096 2008-12-31 16:00 boot
lrw-r--r--   1 root   root        50 2008-12-31 16:00 bugreports -> /data/user_de/0/com.android.shell/files/bugreports
drwxrwx---   6 system cache     4096 2011-01-01 12:00 cache
lrw-r--r--   1 root   root        13 2008-12-31 16:00 charger -> /sbin/charger
drwxr-xr-x   5 root   root         0 1970-01-01 00:00 config
lrw-r--r--   1 root   root        17 2008-12-31 16:00 d -> /sys/kernel/debug
drwxrwx--x  39 system system    4096 2024-12-01 14:40 data
lrw-------   1 root   root        23 2008-12-31 16:00 default.prop -> system/etc/prop.default
drwxr-xr-x  17 root   root      5500 2011-01-01 12:00 dev
lrw-r--r--   1 root   root        11 2008-12-31 16:00 etc -> /system/etc
-rwxr-x---   1 root   shell  2013712 2008-12-31 16:00 init
-rwxr-x---   1 root   shell     1096 2008-12-31 16:00 init.environ.rc
-rwxr-x---   1 root   shell    29622 2024-12-01 14:35 init.rc
-rwxr-x---   1 root   shell    14857 2008-12-31 16:00 init.recovery.amlogic.rc
-rwxr-x---   1 root   shell     7690 2008-12-31 16:00 init.usb.configfs.rc
-rwxr-x---   1 root   shell     5646 2008-12-31 16:00 init.usb.rc
-rwxr-x---   1 root   shell      511 2008-12-31 16:00 init.zygote32.rc
-rwxr-x---   1 root   shell      875 2008-12-31 16:00 init.zygote64_32.rc
drwx------   2 root   root     16384 2008-12-31 16:00 lost+found
drwxr-xr-x   4 root   root      4096 2011-01-01 12:00 metadata
drwxr-xr-x  11 root   system     240 2011-01-01 12:00 mnt
drwxr-xr-x   4 root   root      4096 2008-12-31 16:00 odm
drwxr-xr-x   2 root   root      4096 2008-12-31 16:00 oem
dr-xr-xr-x 260 root   root         0 1970-01-01 00:00 proc
drwxr-xr-x   8 root   root      4096 2008-12-31 16:00 product
drwxr-x---   2 root   shell     4096 2008-12-31 16:00 sbin
lrw-r--r--   1 root   root        21 2008-12-31 16:00 sdcard -> /storage/self/primary
drwxr-xr-x   4 root   root        80 2011-01-01 12:00 storage
dr-xr-xr-x  14 root   root         0 2011-01-01 12:00 sys
drwxr-xr-x  16 root   root      4096 2008-12-31 16:00 system
-rw-r--r--   1 root   root      5272 2008-12-31 16:00 ueventd.rc
drwxr-xr-x  13 root   root      4096 2008-12-31 16:00 vendor
> kvim3l:/system # ls -la
> total 6624
> drwxr-xr-x 16 root root     4096 2008-12-31 16:00 .
> drwxr-xr-x 20 root root     4096 2008-12-31 16:00 ..
> drwxr-xr-x 25 root root     4096 2008-12-31 16:00 app
> drwxr-xr-x  3 root shell    8192 2008-12-31 16:00 bin
> -rw-------  1 root root     1925 2008-12-31 16:00 build.prop
> -rw-r--r--  1 root root    89089 2008-12-31 16:00 compatibility_matrix.xml
> drwxr-xr-x 17 root root     4096 2024-12-01 07:13 etc
> drwxr-xr-x  2 root root     4096 2008-12-31 16:00 fake-libs
> drwxr-xr-x  2 root root     4096 2008-12-31 16:00 fake-libs64
> drwxr-xr-x  2 root root    12288 2008-12-31 16:00 fonts
> drwxr-xr-x  5 root root     4096 2024-12-01 14:27 framework
> drwxr-xr-x  7 root root    12288 2008-12-31 16:00 lib
> drwxr-xr-x  7 root root    16384 2008-12-31 16:00 lib64
> drwxr-xr-x  3 root root     4096 2008-12-31 16:00 media
> drwxr-xr-x  3 root root     4096 2008-12-31 16:00 preinstall
> drwxr-xr-x 50 root root     4096 2008-12-31 16:00 priv-app
> lrw-r--r--  1 root root        8 2008-12-31 16:00 product -> /product
> -rw-r--r--  1 root root  6578813 2008-12-31 16:00 recovery-from-boot.p
> drwxr-xr-x  8 root root     4096 2008-12-31 16:00 usr
> lrw-r--r--  1 root root        7 2008-12-31 16:00 vendor -> /vendor
> drwxr-xr-x  2 root shell   12288 2024-11-30 17:18 xbin

all your previous discussions are no longer relevant, at least for VIM3L. can you tell me where to add my service? I read ALL your previous threads… they are either not relevant or do not work

These require downloading code, and the path of the code is not within the motherboard system

Sorry, but this doesn’t mean anything to me. Just a bunch of words. I’m an ordinary person who needs to run a small script. And I can’t do it… And there are no instructions on HOW to do it. I’ve hated charades and puzzles since I was a kid, and your answer is an offer to complete some kind of quest for a 54-year-old person. And you just can’t write HOW to run the script?

Sorry, this requires adding relevant services in the code. Incorrect SELinux will prevent these from running properly

great…
what services? what are they named? where can I get them?

The download and compilation documents are as follows
https://docs.khadas.com/products/sbc/vim3/development/android/download-android-source-code
https://docs.khadas.com/products/sbc/vim3/development/android/build-android

1 Like