How to format logs, scripts, configs and general console output

In the OpenWrt forum, you oftentimes need to post excerpts of logfiles, configs, shell scripts or other general console output. In order to improve readabilty, please use the "Preformatted text </>" button in the editor bar for such text.

Why?

  • If you just paste this stuff to your posting without applying the proper formatting, the result will probably look awfull (see examples below).
  • Preformatted text is especially good for pasting longer amounts of build logs: not only do you get a fixed-width / non-proportional font for free, you also avoid having to scroll the whole thread over pages, but have the content boxed in with its own scroll bars and limited to a workable size.

How?

Use it the same way as you would use the bold or italic formatting, i.e.

  1. Mark the text that you want to format
  2. Click the "Preformatted text </>" button in the editor bar
    grafik
1 Like

Example #1


without "Preformatted text" formatting

Using username "root".
Authenticating with public key "rsa-key-20110414"

BusyBox v1.30.1 () built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 19.07.4, r11208-ce6496d796


with "Preformatted text" formatting

Using username "root".
Authenticating with public key "rsa-key-20110414"


BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.4, r11208-ce6496d796
 -----------------------------------------------------
1 Like

Example #2


without "Preformatted text" formatting

cat cpuinfo

system type : EcoNet EN7528 SOC
machine : Unknown
processor : 0
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 591.87
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
VPE : 0

processor : 1
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 449.74
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
VPE : 1

processor : 2
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 634.88
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
package : 0
core : 1
VCED exceptions : not available
VCEI exceptions : not available
VPE : 0

processor : 3
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 640.61
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
package : 0
core : 1
VCED exceptions : not available
VCEI exceptions : not available
VPE : 1


with "Preformatted text" formatting

# cat cpuinfo
system type             : EcoNet EN7528 SOC
machine                 : Unknown
processor               : 0
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 591.87
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
VPE                     : 0

processor               : 1
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 449.74
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available
VPE                     : 1

processor               : 2
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 634.88
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 1
VCED exceptions         : not available
VCEI exceptions         : not available
VPE                     : 0

processor               : 3
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 640.61
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
package                 : 0
core                    : 1
VCED exceptions         : not available
VCEI exceptions         : not available
VPE                     : 1
1 Like

Example #3


without "Preformatted text" formatting

root@FB4040:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.0M 3.0M 0 100% /rom
tmpfs 122.5M 12.1M 110.5M 10% /tmp
/dev/mtdblock14 23.5M 14.7M 8.8M 63% /overlay
overlayfs:/overlay 23.5M 14.7M 8.8M 63% /
tmpfs 512.0K 0 512.0K 0% /dev


with "Preformatted text" formatting

root@FB4040:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.0M      3.0M         0 100% /rom
tmpfs                   122.5M     12.1M    110.5M  10% /tmp
/dev/mtdblock14          23.5M     14.7M      8.8M  63% /overlay
overlayfs:/overlay       23.5M     14.7M      8.8M  63% /
tmpfs                   512.0K         0    512.0K   0% /dev
1 Like

Example #4


without "Preformatted text" formatting

root@XiaoQiang:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
3: 3 4164499 0 0 MIPS GIC eth0
4: 0 0 714439 0 MIPS GIC wl0
7: 197579 197495 197532 197533 MIPS GIC timer
11: 0 0 0 0 MIPS GIC HS_DMA
12: 0 0 0 0 MIPS GIC ralink_gpio
23: 3 0 0 0 MIPS GIC Ralink_ESW
26: 227 0 0 0 MIPS GIC serial
56: 9049 0 0 0 MIPS GIC IPI_resched
57: 0 9441 0 0 MIPS GIC IPI_resched
58: 0 0 7601 0 MIPS GIC IPI_resched
59: 0 0 0 9623 MIPS GIC IPI_resched
60: 41645 0 0 0 MIPS GIC IPI_call
61: 0 29443 0 0 MIPS GIC IPI_call
62: 0 0 46732 0 MIPS GIC IPI_call
63: 0 0 0 42637 MIPS GIC IPI_call
ERR: 0


with "Preformatted text" formatting

root@XiaoQiang:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
  3:          3    4164499          0          0  MIPS GIC  eth0
  4:          0          0     714439          0  MIPS GIC  wl0
  7:     197579     197495     197532     197533  MIPS GIC  timer
 11:          0          0          0          0  MIPS GIC  HS_DMA
 12:          0          0          0          0  MIPS GIC  ralink_gpio
 23:          3          0          0          0  MIPS GIC  Ralink_ESW
 26:        227          0          0          0  MIPS GIC  serial
 56:       9049          0          0          0  MIPS GIC  IPI_resched
 57:          0       9441          0          0  MIPS GIC  IPI_resched
 58:          0          0       7601          0  MIPS GIC  IPI_resched
 59:          0          0          0       9623  MIPS GIC  IPI_resched
 60:      41645          0          0          0  MIPS GIC  IPI_call
 61:          0      29443          0          0  MIPS GIC  IPI_call
 62:          0          0      46732          0  MIPS GIC  IPI_call
 63:          0          0          0      42637  MIPS GIC  IPI_call
ERR:          0
1 Like

Example #5


without "Preformatted text" formatting

$ binwalk RE450_bricked.bin

DECIMAL HEXADECIMAL DESCRIPTION

14608 0x3910 U-Boot version string, "U-Boot 1.1.4 (Dec 15 2017 - 15:14:42)"
14656 0x3940 CRC32 polynomial table, big endian
15952 0x3E50 uImage header, header size: 64 bytes, header CRC: 0x8555A513, created: 2017-12-15 07:14:42, image size: 39666 bytes, Data Address: 0x80010000, Entry Point: 0x80010000, data CRC: 0xD26A2F81, OS: Linux, CPU: MIPS, image type: Firmware Image, compression type: lzma, image name: "u-boot image"
16016 0x3E90 LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 106000 bytes
153892 0x25924 U-Boot version string, "U-Boot 1.1.4 (Dec 15 2017 - 15:14:42)"
153940 0x25954 CRC32 polynomial table, big endian
155236 0x25E64 uImage header, header size: 64 bytes, header CRC: 0x8555A513, created: 2017-12-15 07:14:42, image size: 39666 bytes, Data Address: 0x80010000, Entry Point: 0x80010000, data CRC: 0xD26A2F81, OS: Linux, CPU: MIPS, image type: Firmware Image, compression type: lzma, image name: "u-boot image"
155300 0x25EA4 LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 106000 bytes
194967 0x2F997 TP-Link firmware header, firmware version: 0.0.0, image version: "", product ID: 0x0, product version: 0, kernel load address: 0x0, kernel entry point: 0x80002000, kernel offset: 0, kernel length: 512, rootfs offset: 770417, rootfs length: 0, bootloader offset: 0, bootloader length: 0
195479 0x2FB97 LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 2207564 bytes
965897 0xEBD09 Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 3634385 bytes, 669 inodes, blocksize: 1048576 bytes, created: 2017-12-15 07:25:27
4653056 0x470000 JFFS2 filesystem, big endian


with "Preformatted text" formatting

$ binwalk RE450_bricked.bin 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
14608         0x3910          U-Boot version string, "U-Boot 1.1.4 (Dec 15 2017 - 15:14:42)"
14656         0x3940          CRC32 polynomial table, big endian
15952         0x3E50          uImage header, header size: 64 bytes, header CRC: 0x8555A513, created: 2017-12-15 07:14:42, image size: 39666 bytes, Data Address: 0x80010000, Entry Point: 0x80010000, data CRC: 0xD26A2F81, OS: Linux, CPU: MIPS, image type: Firmware Image, compression type: lzma, image name: "u-boot image"
16016         0x3E90          LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 106000 bytes
153892        0x25924         U-Boot version string, "U-Boot 1.1.4 (Dec 15 2017 - 15:14:42)"
153940        0x25954         CRC32 polynomial table, big endian
155236        0x25E64         uImage header, header size: 64 bytes, header CRC: 0x8555A513, created: 2017-12-15 07:14:42, image size: 39666 bytes, Data Address: 0x80010000, Entry Point: 0x80010000, data CRC: 0xD26A2F81, OS: Linux, CPU: MIPS, image type: Firmware Image, compression type: lzma, image name: "u-boot image"
155300        0x25EA4         LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 106000 bytes
194967        0x2F997         TP-Link firmware header, firmware version: 0.0.0, image version: "", product ID: 0x0, product version: 0, kernel load address: 0x0, kernel entry point: 0x80002000, kernel offset: 0, kernel length: 512, rootfs offset: 770417, rootfs length: 0, bootloader offset: 0, bootloader length: 0
195479        0x2FB97         LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 2207564 bytes
965897        0xEBD09         Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 3634385 bytes, 669 inodes, blocksize: 1048576 bytes, created: 2017-12-15 07:25:27
4653056       0x470000        JFFS2 filesystem, big endian
2 Likes