| 64 | Changes in hybris/hybris-boot/Android.mk |
| 65 | - define a variable for the panic module (next to BB_STATIC) |
| 66 | {{{ |
| 67 | PM_STATIC := $(PRODUCT_OUT)/vendor/lib/modules/panic.ko |
| 68 | }}} |
| 69 | - copy the PM_STATIC to the /bin directory (next to "@cp $(BB_STATIC) $(BOOT_INTERMEDIATE)/initramfs/bin/") |
| 70 | {{{ |
| 71 | @cp $(PM_STATIC) $(BOOT_INTERMEDIATE)/initramfs/bin/ |
| 72 | }}} |
| 73 | |
| 74 | === Usage in init === |
| 75 | See also [https://github.com/guhl/hybris-boot_chiron/commit/3dc13787ed18abcd1a9f76c81a67d1e489603320] |
| 76 | |
| 77 | To write to pstore and cause a kernel panic add something like |
| 78 | {{{ |
| 79 | # first test of pstore / panic |
| 80 | cat /init.log > /dev/pmsg0 |
| 81 | /bin/busybox insmod /bin/panic.ko |
| 82 | }}} |
| 83 | to hybris/hybris-boot/init-script where ever you want to see the init.log or output additional information. |
| 84 | |
| 85 | Then build the boot image using make hybrs-boot in HABUILD and boot it using fastboot boot. |
| 86 | After the kernel panic and the reboot boot to recovery or LOS and check the files in /sys/fs/pstore |
| 87 | |
| 88 | /sys/fs/pstore/console-ramoops-0 and /sys/fs/pstore/dmesg-ramoops-0 should contain |
| 89 | {{{ |
| 90 | <0>[ 3.596679] Kernel panic - not syncing: Guhl caused a kernel panic! |
| 91 | }}} |
| 92 | |
| 93 | /sys/fs/pstore/pmsg-ramoops-0 should contain the init.log of mer and look something like |
| 94 | {{{ |
| 95 | + exec |
| 96 | + echo Running Mer Boat Loader |
| 97 | Running Mer Boat Loader |
| 98 | + BOOTLOGO= |
| 99 | + ALWAYSDEBUG= |
| 100 | + DATA_PARTITION=/dev/sda17 |
| 101 | + DEFAULT_OS=sailfishos |
| 102 | + export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin |
| 103 | + USB_FUNCTIONS=rndis |
| 104 | + ANDROID_USB=/sys/class/android_usb/android0 |
| 105 | + GADGET_DIR=/config/usb_gadget |
| 106 | + LOCAL_IP=192.168.2.15 |
| 107 | + DONE_SWITCH=no |
| 108 | + [ /init = /init-debug ] |
| 109 | + [ no = no ] |
| 110 | + EXPLICIT_BUSYBOX= |
| 111 | + TELNET_DEBUG_PORT=23 |
| 112 | + /bin/busybox --install -s |
| 113 | + date |
| 114 | Sat Nov 28 00:15:15 UTC 1970 |
| 115 | + do_mount_devprocsys |
| 116 | + echo ########################## mounting devprocsys |
| 117 | ########################## mounting devprocsys |
| 118 | + mkdir /dev |
| 119 | mkdir: can't create directory '/dev': File exists |
| 120 | + mount -t devtmpfs devtmpfs /dev |
| 121 | + mkdir /dev/pts |
| 122 | + mount -t devpts devpts /dev/pts |
| 123 | + mkdir /proc |
| 124 | + mkdir /sys |
| 125 | + mount -t sysfs sysfs /sys |
| 126 | + mount -t proc proc /proc |
| 127 | + mkdir /config |
| 128 | + mount -t configfs none /config |
| 129 | + do_hotplug_scan |
| 130 | + echo /sbin/mdev |
| 131 | + mdev -s |
| 132 | + sleep 2 |
| 133 | + cat /init.log |
| 134 | }}} |