#
Debug Mode Guide for Bliss OS/Bass OS
Bliss OS/Bass OS provides two debug modes: DEBUG=1 and DEBUG=2. These modes offer different features and troubleshooting steps to help you debug a device that is not booting correctly.
#
DEBUG=1
When you set DEBUG=1, the following features are enabled:
- Detailed boot logs: This mode provides verbose boot logs that can help you identify any issues during the boot process.
- Serial console access: You can access the serial console to view and interact with the boot process.
- Debug kernel messages: This mode displays debug kernel messages that can provide insights into any kernel-related issues.
(Please note that you will have to enter 'exit' once from this debugging console to continue booting the OS)
To enable DEBUG=1, follow these steps:
- Boot your device into the bootloader.
- Press the appropriate key to access the bootloader menu (usually F2 or Esc).
- Navigate to the "Debug" or "Advanced" menu.
- Highlight the "Debug" option.
- Tap 'e' to edit the boot option.
- Set the
DEBUGoption to1. - Tap 'F10' to save the changes and boot the option.
- The device will now boot into debug mode.
#
DEBUG=2
When you set DEBUG=2, the following features are enabled:
- Detailed boot logs: This mode provides verbose boot logs that can help you identify any issues during the boot process.
- Serial console access: You can access the serial console to view and interact with the boot process.
- Debug kernel messages: This mode displays debug kernel messages that can provide insights into any kernel-related issues.
- Additional troubleshooting options:
DEBUG=2drops you to console before the initial init layer starts. This allows you to modify boot parameters, access low-level system information, and perform other advanced troubleshooting tasks.
(Please note that you will have to enter 'exit' twice from this debugging console to continue booting the OS)
To enable DEBUG=2, follow these steps:
- Boot your device into the bootloader.
- Press the appropriate key to access the bootloader menu (usually F2 or Esc).
- Navigate to the "Debug" or "Advanced" menu.
- Tap 'e' to edit the boot option.
- Set the
DEBUGoption to2. - Tap 'F10' to save the changes and boot the option.
- The device will now boot into debug mode.
#
Troubleshooting Steps
Here are some common troubleshooting steps you can follow in debug mode:
Check the boot logs: Review the detailed boot logs to identify any errors or issues that may be causing the device to fail to boot. This command opens the boot log file in Vim for editing:
vi /tmp/log- Access the serial console: Use the serial console to interact with the boot process and gather more information about the issue.
Check kernel messages: Review the debug kernel messages to identify any kernel-related issues.
dmesg > /tmp/dmesg.logThen read it using Vim.
vi /tmp/dmesg.log- Change boot parameters: In
DEBUG=2mode, you can modify boot parameters to troubleshoot specific issues. - Access low-level system information: In
DEBUG=2mode, you can access low-level system information to diagnose hardware-related issues.
#
Collecting the Boot Log from /tmp/log to an External USB Drive
- Boot your device into debug mode (
DEBUG=1orDEBUG=2). - Connect an external USB drive to your device.
Mount the USB drive to a directory on your device. For example, you can use the following command to mount the USB drive to
/mnt:sudo mount /dev/sdX /mntReplace
/dev/sdXwith the actual device name of your USB drive.Copy the boot log from
/tmp/logto the USB drive. You can use the following command to copy the file:sudo cp /tmp/log /mnt/boot_log.txtThis command copies the contents of
/tmp/logto the/mnt/boot_log.txtfile on the USB drive.Unmount the USB drive when you're done:
sudo umount /mntThis command safely unmounts the USB drive from your device.
Now you have the boot log saved to the external USB drive for further analysis.
#
Collecting dmesg Output to an External USB Drive
- Boot your device into debug mode (
DEBUG=1orDEBUG=2). - Connect an external USB drive to your device.
Mount the USB drive to a directory on your device. For example, you can use the following command to mount the USB drive to
/mnt:sudo mount /dev/sdX /mntReplace
/dev/sdXwith the actual device name of your USB drive.Run the
dmesgcommand to collect the kernel messages:sudo dmesg > /mnt/dmesg.txtThis command redirects the output of
dmesgto the/mnt/dmesg.txtfile on the USB drive.Unmount the USB drive when you're done:
sudo umount /mntThis command safely unmounts the USB drive from your device.
Now you have the dmesg output saved to the external USB drive for further analysis.
Remember to consult the official documentation for Bliss OS/Bass OS for more detailed information on using the debug modes and troubleshooting specific issues.
#
Debugging with a Live Linux (Ubuntu) USB
If you have access to a Live Linux (Ubuntu) USB, you can use it to debug your Bliss OS/Bass OS device. Here's how you can do it:
- Boot your device into debug mode (
DEBUG=1orDEBUG=2). - Type
'exit'to continue booting the device. - Boot until the device hangs or encounters an issue.
- Power off the device.
- Boot into the Live Linux (Ubuntu) USB. Make sure it supports the architecture of your device (e.g., 32-bit or 64-bit).
- Once the Live Linux (Ubuntu) USB is booted, connect it to your device using a USB cable.
- Open a terminal on the Live Linux (Ubuntu) USB.
Run the following command to mount the drive of your Bliss OS/Bass OS device:
sudo mount /dev/sdX /mntReplace
/dev/sdXwith the actual device name of your Bliss OS/Bass OS device.Navigate to the mounted drive using the
cdcommand. For example:cd /mntFind the
/tmp/logfile on the mounted drive. You can use thelscommand to list the files and directories. For example:lsCopy the
/tmp/logfile from the mounted drive to the Live Linux (Ubuntu) USB. You can use thecpcommand to copy the file. For example:sudo cp /mnt/tmp/log /path/to/destination/on/the/Live/Linux/USB/log.txtReplace
/path/to/destination/on/the/Live/Linux/USBwith the actual path where you want to save the file on the Live Linux (Ubuntu) USB.Unmount the drive when you're done:
sudo umount /mnt- Now you can use the Live Linux (Ubuntu) USB to analyze the copied log file using tools like Vim, grep, or any other text editors or utilities available on the Live Linux (Ubuntu) USB.
#
Navigating Saved Logs with Vim
Once you have saved the boot log or dmesg output to an external USB drive, you can use Vim to navigate and analyze the logs. Here are some common Vim commands to help you navigate the saved logs:
j: Move down one line.k: Move up one line.Ctrl + d: Scroll down half a screen.Ctrl + u: Scroll up half a screen.gg: Move to the beginning of the file.G: Move to the end of the file.i: Enter insert mode at the beginning of a line.a: Enter insert mode at the end of a line.Esc: Exit insert mode.yy: Copy current line.p: Paste after the cursor.P: Paste before the cursor.:w: Save the file.:q: Quit the file.:q!: Quit the file without saving.:wq: Save the file and quit.
These commands should help you navigate and analyze the saved logs using Vim. Remember to consult the Vim documentation for more advanced commands and features.