U-boot serial console output disabled

362 views
Skip to first unread message

Robert Cachro

unread,
Jul 17, 2020, 6:25:19 PM7/17/20
to BeagleBoard
Hi,

In an effort to mitigate a potential security vulnerability, I am attempting to disable u-boot Serial Console output which I am monitoring via FTDI. This can be done by modifying the source of U-Boot to configure the device for silent booting (https://github.com/rickyzhang82/u-boot4bbb/blob/master/doc/README.silent)

I am running Debian 9.9 Stretch IoT on a Beaglebone Black Wireless.

Here is what I have done thus far:
-------------------------------------------------
Download U-boot
-----------------------------------------------
tar -xjf u-boot-2019.04.tar.bz2
cd u-boot-2019.04/

patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch
patch -p1 < 0002-U-Boot-BeagleBone-Cape-Manager.patch
-------------------------------------------------
Modify U-boot to disable console output
-------------------------------------------------
cd /u-boot-2019.04/include/configs
vim am335x_evm.h
(add bolded)
#define CONFIG_SILENT_CONSOLE
#define CONFIG_SYS_DEVICE_NULLDEV
#define CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
#define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
        DEFAULT_MMC_TI_ARGS \
        DEFAULT_FIT_TI_ARGS \
        "bootpart=0:2\0" \
        "bootdir=/boot\0" \
        "bootfile=zImage\0" \
        "board_eeprom_header=undefined\0" \
        "fdtfile=undefined\0" \
        "silent=1\0" \
        "console=ttyO0,115200n8\0" \
-------------------------------------------------
Compile
-------------------------------------------------
cd ../..
make ARCH=arm CROSS_COMPILE=${CC} distclean
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_defconfig
make ARCH=arm CROSS_COMPILE=${CC}
ls -l MLO u-boot.img
-------------------------------------------------
Update u-boot on image
-------------------------------------------------
dd if=MLO of=/dev/mmcblk1 bs=512 seek=256 count=256 conv=notrunc
dd if=u-boot.img of=/dev/mmcblk1 bs=512 seek=768 count=1024 conv=notrunc
-------------------------------------------------
Reboot
-------------------------------------------------


However, the serial console which I am monitoring via FTDI cable still shows output.


Any thoughts? 

I think the final step, where I update u-boot on my current image, may not be done correctly.


Thank you,

Robert

Robert Cachro

unread,
Jul 20, 2020, 12:04:10 AM7/20/20
to BeagleBoard
I guess the real question is, how do we update the Beaglebone's MLO and u-boot.img if we are running the OS from eMMC?

Thanks,
Robert

Robert Nelson

unread,
Jul 20, 2020, 10:16:31 AM7/20/20
to Beagle Board, robert...@gmail.com
On Sun, Jul 19, 2020 at 11:04 PM Robert Cachro <robert...@gmail.com> wrote:
>
> I guess the real question is, how do we update the Beaglebone's MLO and u-boot.img if we are running the OS from eMMC?

Open /boot/uEnv.txt and add "silent=1" to the end of the enabled
"cmdline=" value..

Regards,

--
Robert Nelson
https://rcn-ee.com/

Robert Cachro

unread,
Jul 20, 2020, 10:30:43 AM7/20/20
to BeagleBoard
Is it that easy...? 

I tried though and no cigar.

cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet silent=1

FTDI serial port still shows logging

U-Boot SPL 2019.04 (Jul 17 2020 - 21:33:18 +0000)
Trying to boot from MMC2
Loading Environment from EXT4... Card did not respond to voltage select!


U-Boot 2019.04 (Jul 17 2020 - 21:33:18 +0000)

CPU  : AM335X-GP rev 2.1
I2C:   ready
DRAM:  512 MiB

...
...
...

Thanks,
Robert

Robert Nelson

unread,
Jul 20, 2020, 11:04:43 AM7/20/20
to Beagle Board
On Mon, Jul 20, 2020 at 9:31 AM Robert Cachro <robert...@gmail.com> wrote:
>
> Is it that easy...?
>
> I tried though and no cigar.
>
> cmdline=coherent_pool=1M net.ifnames=0 rng_core.default_quality=100 quiet silent=1
>
> FTDI serial port still shows logging
>
> U-Boot SPL 2019.04 (Jul 17 2020 - 21:33:18 +0000)
> Trying to boot from MMC2
> Loading Environment from EXT4... Card did not respond to voltage select!
>
>
> U-Boot 2019.04 (Jul 17 2020 - 21:33:18 +0000)
>
> CPU : AM335X-GP rev 2.1
> I2C: ready
> DRAM: 512 MiB
>
> ...
> ...
> ...

Idk, i got a little bit to be disabled...

BeagleBone: cape eeprom: i2c_probe: 0x56:
BeagleBone: cape eeprom: i2c_probe: 0x57:
Net: eth0: MII MODE
cpsw, usb_ether
Press SPACE to abort autoboot in 0 seconds
[ 0.002632] timer_probe: no matching timers found
[ 0.224072] l3-aon-clkctrl:0000:0: failed to disable
[ 1.762727] wkup_m3_ipc 44e11324.wkup_m3_ipc: could not get rproc handle

diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 41aa4f2..86c91ea 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -5,7 +5,11 @@ CONFIG_AM33XX=y
CONFIG_SPL=y
CONFIG_DISTRO_DEFAULTS=y
CONFIG_BOOTDELAY=0
-CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run
update_to_fit; fi; run findfdt; run init_console; run envboot; run
distro_bootcmd"
+CONFIG_BOOTCOMMAND="setenv silent 1; if test ${boot_fit} -eq 1; then
run update_to_fit; fi; run findfdt; run init_console; run envboot; run
distro_bootcmd"
+CONFIG_DISABLE_CONSOLE=y
+CONFIG_LOGLEVEL=0
+CONFIG_SILENT_CONSOLE=y
+CONFIG_SILENT_U_BOOT_ONLY=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_VERSION_VARIABLE=y
CONFIG_ARCH_MISC_INIT=y


On top of this patch:

https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-Bootloader:U-Boot

and you can update the blobs on the eMMC via the dd lines here:

https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-SetupmicroSDcard

Robert Cachro

unread,
Jul 20, 2020, 1:00:38 PM7/20/20
to beagl...@googlegroups.com
Your output looks much better than mine. Recompiled fresh u-boot with patches and updated blobs on the eMMC via:

export DISK=/dev/mmcblk0

sudo dd if=/u-boot/MLO of=${DISK} count=1 seek=1 bs=128k
sudo dd if=/u-boot/u-boot.img of=${DISK} count=2 seek=1 bs=384k


However, lsblk yields:

NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk1      179:0    0  3.6G  0 disk
└─mmcblk1p1  179:1    0  3.6G  0 part /
mmcblk1boot0 179:8    0    4M  1 disk
mmcblk1boot1 179:16   0    4M  1 disk
mmcblk1rpmb  179:24   0    4M  0 disk

Is eMMC mmcblk0 as I see all over the forums or mmcblk1 as shown above?

Neither seem to silence the serial console output. uEnv.txt attached.

Thanks


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/KeQ5-T3raZ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAOCHtYgPCMfgY58uybeK7oYH-6Qwt%2Bx%3DM9k9VpKjsR_ohtMWKw%40mail.gmail.com.
uEnv.txt

Robert Nelson

unread,
Jul 20, 2020, 1:23:46 PM7/20/20
to Beagle Board
On Mon, Jul 20, 2020 at 12:00 PM Robert Cachro <robert...@gmail.com> wrote:
>
> Your output looks much better than mine. Recompiled fresh u-boot with patches and updated blobs on the eMMC via:
>
> export DISK=/dev/mmcblk0
>
> sudo dd if=/u-boot/MLO of=${DISK} count=1 seek=1 bs=128k
> sudo dd if=/u-boot/u-boot.img of=${DISK} count=2 seek=1 bs=384k
>
> However, lsblk yields:
>
> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
> mmcblk1 179:0 0 3.6G 0 disk
> └─mmcblk1p1 179:1 0 3.6G 0 part /
> mmcblk1boot0 179:8 0 4M 1 disk
> mmcblk1boot1 179:16 0 4M 1 disk
> mmcblk1rpmb 179:24 0 4M 0 disk
>
> Is eMMC mmcblk0 as I see all over the forums or mmcblk1 as shown above?

Use what lsblk lists. ;)

export DISK=/dev/mmcblk1

Robert Cachro

unread,
Jul 20, 2020, 1:40:37 PM7/20/20
to BeagleBoard
Thanks Robert. Appreciate the help!
Reply all
Reply to author
Forward
0 new messages