Difference between revisions of "Inspecting the initramfs"

From postmarketOS
Jump to: navigation, search
m (Enable initramfs-extra)
(Fix flash boot command)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
 
<source lang="shell-session">
 
<source lang="shell-session">
 
$ pmbootstrap initfs hook_add debug-shell
 
$ pmbootstrap initfs hook_add debug-shell
$ pmbootstrap flasher boot # or however you flash/boot the kernel
+
$ pmbootstrap flasher flash_kernel # or however you flash/boot the kernel
 
(wait until the device booted up and you are connected to it)
 
(wait until the device booted up and you are connected to it)
 
$ telnet 172.16.42.1
 
$ telnet 172.16.42.1
Line 35: Line 35:
 
</source>
 
</source>
  
Here '$initramfs_extra' is the path of the file .(for lg-bullhead whole command will be 'extract_initramfs_extra ./boot/initramfs-lg-bullhead-extra')
+
Here '$initramfs_extra' is the path of the file .(for lg-bullhead whole command will be 'extract_initramfs_extra ./boot/initramfs-lg-bullhead-extra' with out quotation.
  
 
=== Additional programs ===
 
=== Additional programs ===

Latest revision as of 16:24, 25 April 2019

This is considered a security hole. Only use it for debugging, and uninstall the debug-shell hook afterwards.

This page explains how to connect to your device when it has booted to the initramfs by installing the debug-shell hook. This is useful if you want to know more about the boot process, simply inspect the initramfs or if you want to debug why something doesn't work.

It is possible to enable a telnet daemon that gives you a shell this way:

$ pmbootstrap initfs hook_add debug-shell
$ pmbootstrap flasher flash_kernel # or however you flash/boot the kernel
(wait until the device booted up and you are connected to it)
$ telnet 172.16.42.1
Trying 172.16.42.1...
Connected to 172.16.42.1.
Escape character is '^]'.

Type 'pmos_continue_boot' to continue booting:
# echo "hello world"
hello world
# pmos_continue_boot
Connection closed by foreign host.

If the telnet command does not work out of the box, read connect via USB Networking in the Initramfs.

Enable initramfs-extra

To enable functionality from initramfs-extra, run the following commands in the shell:

# . init_functions.sh
# mount_boot_partition
Mount boot partition (/dev/dm-0)
# extract_initramfs_extra $initramfs_extra
Extract /boot/initramfs-sony-amami-extra
24128 blocks

Here '$initramfs_extra' is the path of the file .(for lg-bullhead whole command will be 'extract_initramfs_extra ./boot/initramfs-lg-bullhead-extra' with out quotation.

Additional programs

After installing the debug-shell initramfs hook, the evtest, fftest and fbdebug programs are available in the initramfs (#1358).

Tips and tricks