summaryrefslogtreecommitdiff
path: root/META-INF/com/google/android/updater-script
blob: efd208cd35dec1188fc7b7182961d210250badc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
show_progress(1.34, 4);
ui_print(" ");
assert(package_extract_dir("", "/tmp/anykernel"));
ui_print(file_getprop("/tmp/anykernel/anykernel.sh", "kernel.string"));
ui_print(" ");
ui_print("AnyKernel2 by osm0sis @ xda-developers");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
ifelse(file_getprop("/tmp/anykernel/anykernel.sh", "do.devicecheck") == 1,
  (ui_print("Checking device...");
   ui_print(" ");
   assert(getprop("ro.product.device") == file_getprop("/tmp/anykernel/anykernel.sh", "device.name1") || getprop("ro.build.product") == file_getprop("/tmp/anykernel/anykernel.sh", "device.name1") ||
          getprop("ro.product.device") == file_getprop("/tmp/anykernel/anykernel.sh", "device.name2") || getprop("ro.build.product") == file_getprop("/tmp/anykernel/anykernel.sh", "device.name2") ||
          getprop("ro.product.device") == file_getprop("/tmp/anykernel/anykernel.sh", "device.name3") || getprop("ro.build.product") == file_getprop("/tmp/anykernel/anykernel.sh", "device.name3"));
  )
);
ifelse(file_getprop("/tmp/anykernel/anykernel.sh", "do.initd") == 1,
  (ui_print("Creating init.d...");
   ui_print(" ");
   run_program("/sbin/sh", "-c", "mkdir /system/etc/init.d");
   set_perm_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
  )
);
ui_print("Installing kernel...");
run_program("/sbin/sh", "/tmp/anykernel/anykernel.sh");
ifelse(run_program("/sbin/sh", "-c", "test `cat /tmp/anykernel/exitcode` == 1") == 0, 
  (unmount("/system");
   abort();
  )
);
ifelse(file_getprop("/tmp/anykernel/anykernel.sh", "do.modules") == 1,
  (ui_print("Pushing modules...");
   ui_print(" ");
   assert(package_extract_dir("modules", "/system/lib/modules"),
          set_perm_recursive(0, 0, 0755, 0644, "/system/lib/modules"));
  )
);
ifelse(file_getprop("/tmp/anykernel/anykernel.sh", "do.cleanup") == 1,
  (delete_recursive("/tmp/anykernel");
  )
);
unmount("/system");
ui_print(" ");
ui_print("Done!");