アプリケーションでMA-E320についているシリアルポートを両方共使用したい、というような場合に、
Kernel起動以降のコンソール出力を止める方法を紹介します。
CONSOLEポートをシリアルポートとして使用する場合、市販のRS-45 - DSUB9変換アダプタを使用し、
必要な信号線を接続する必要があります。
参考: 8極8芯モジュラー・232C(9Pメス)変換 (千石電商)
【数量1個~】単価 ¥672
ブートローダにて、/env/config ファイルを編集します。
参照: ブートローダーでの操作
barebox@plum-ma[1GiB]:/ cat /env/config #!/bin/sh # change network settings in /env/network/eth0 # change mtd partition settings and automountpoints in /env/init/* #global.hostname= # set to false if you do not want to have colors #global.allow_color=true # user (used for network filenames) #global.user=none # timeout in seconds before the default boot entry is started global.autoboot_timeout=2 # list of boot entries. These are executed in order until one # succeeds. An entry can be: # - a filename in /env/boot/ # - a full path to a directory. All files in this directory are # treated as boot files and executed in alphabetical order #global.boot.default=net # base bootargs #global.linux.bootargs.base="ubi.mtd=0 mtdoops.mtddev=OOPS mtdoops.record_size=8192 zswap.enabled=1" # don't format MTD automatically #manual_mtd=1 # single page firmware #firmware_pages=1 # never use mmc as overlay #overlay=tmpfs # select overlayfs as overlay filesystem driver #overlay_driver=overlayfs # don't mount JRE partition #nojre=1 # set kernel console as 'ttyO2' (internal) #console_internal=1 <-- barebox@plum-ma[1GiB]:/
edit コマンドで /env/config ファイルをオープンし、最後の行の “console_internal” の
コメントを外します。
Ctrl+D で保存後、saveenv で変更した内容を保存し、再起動します。
シリアルポートには、Kernel起動までのメッセージのみが出力されます。
barebox 2013.12.0-00254-g291c1b0 #262 Wed Feb 19 12:09:30 JST 2014 Board: plum-ma[1GiB] m25p80 m25p800: m25p16 (2048 Kbytes) booting from SPI barebox 2013.12.0-00341-gb190004 #553 Tue Jun 3 10:50:00 JST 2014 Board: plum-ma[1GiB] nand: ONFI param page 0 valid nand: ONFI flash detected nand: NAND device: Manufacturer ID: 0x01, Chip ID: 0xda (AMD/Spansion S34ML02G1), 256MiB, page size: 2048, OOB size: 64 omap-hsmmc omap4-hsmmc0: registered as omap4-hsmmc0 m25p80 m25p800: m25p16 (2048 Kbytes) i2c-omap i2c-am33xx0: bus 0 rev0.11 at 100 kHz cpsw cpsw0: detected phy mask 0xc mdio_bus: miibus0: probed eth0: got preset MAC address: D0:FF:50:E0:EE:68 malloc space: 0x8e000000 -> 0x9dffffff (size 256 MiB) Reset is caused by "Warm Reset". running /env/bin/init... filetype: No such file or directory UBI: attaching mtd0 to ubi0 UBI: scanning is finished registering /dev/ubi0 registering kernel.0 as /dev/ubi0.kernel.0 registering kernel.1 as /dev/ubi0.kernel.1 registering initramfs.0 as /dev/ubi0.initramfs.0 registering initramfs.1 as /dev/ubi0.initramfs.1 registering kmod.0 as /dev/ubi0.kmod.0 registering kmod.1 as /dev/ubi0.kmod.1 registering rootfs.0 as /dev/ubi0.rootfs.0 registering rootfs.1 as /dev/ubi0.rootfs.1 registering opt as /dev/ubi0.opt registering overlay as /dev/ubi0.overlay UBI: attached mtd0 (name "nand0.UBI", size 255 MiB) to ubi0 UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512 UBI: VID header offset: 512 (aligned 512), data offset: 2048 UBI: good PEBs: 2040, bad PEBs: 0, corrupted PEBs: 0 UBI: user volume: 10, internal volumes: 1, max. volumes count: 128 UBI: max/mean erase counter: 14/9, WL threshold: 4096, image sequence number: 31184 UBI: available PEBs: 0, total reserved PEBs: 2040, PEBs reserved for bad PEB handling: 40 Hit m for menu or any other key to stop autoboot: 0 booting nand firm_kind0: 1 firm_area0: 1 dipsw: 1 overlay: tmpfs overlay_driver: aufs [5] boot with latest firmware succeeded. bootm.image: /dev/ubi0.kernel.1 bootm.oftree: /dev/spi.dtb.1 bootm.initrd: /dev/ubi0.initramfs.1 bootargs.dyn.root: root=AREA=1 bootargs.dyn.watchdog: bootargs.dyn.console: console=ttyO2,115200 bootargs.dyn.cleanboot bootargs.dyn.nojre bootargs.dyn.overlay overlay=tmpfs bootargs.dyn.overlay_driver overlay_driver=aufs boot_info: 0x11 Image Name: Linux-3.14.5+ Created: 2014-06-05 9:47:30 UTC OS: Linux Architecture: ARM Type: Kernel Image Compression: uncompressed Data Size: 3429600 Bytes = 3.3 MiB Load Address: 80008000 Entry Point: 80008000 Loading OS U-Boot uImage '/dev/ubi0.kernel.1' Loading devicetree from '/dev/spi.dtb.1' plum_of_fixup: eXternal I/O board's ID is 0x03, fixup device-tree... commandline: ubi.mtd=0 mtdoops.mtddev=OOPS mtdoops.record_size=8192 zswap.enabled=1 root=AREA=1 console=ttyO 2,115200 overlay=tmpfs overlay_driver=aufs rootdelay=1 booting kernel with devicetree