This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Overall boot time optimization reduction

Dear TI e2E community,

I need to reduce the boot time to less than 8 seconds atleast & am using ti sdk 8 with argo-base rootfs, the below is the logs but I see more time is consuming after INIT process, could anybody please let me know is there any chances of reducing the boot time still in using any other rootfs??, still I can remove dropbear, I need to remove the login could you please let me know this can be done in rootfs??

logs:


0.000 0.000: 0.004 0.004: U-Boot SPL 2014.07 (Aug 29 2015 - 16:18:34)
1.712 1.708: reading u-boot.img
1.716 0.005: reading u-boot.img
1.779 0.063:
1.779 0.000:
1.783 0.003: U-Boot 2014.07 (Aug 29 2015 - 16:18:34)
1.783 0.000:
1.837 0.054: I2C:   ready
1.838 0.001: DRAM:  256 MiB
1.934 0.096: MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
2.107 0.172: Net:   cpsw, usb_ether
3.116 1.009: Hit any key to stop autoboot:  0
3.131 0.015: Card did not respond to voltage select!
3.143 0.013: Card did not respond to voltage select!
3.147 0.004: checking for valid boot partition .....
3.153 0.005: system boots with normal boot partition 3 ....
3.156 0.003: Saving Environment to MMC...
3.312 0.157: Writing to redundant MMC(1)... done
3.315 0.003: Saving Environment to MMC...
3.470 0.155: Writing to MMC(1)... done
3.534 0.064: switch to partitions #0, OK
3.537 0.003: mmc1(part 0) is current device
3.598 0.062: SD/MMC found on device 1
3.602 0.004: reading uEnv.txt
3.607 0.005: ** Unable to read file uEnv.txt **
3.956 0.350: 2968968 bytes read in 340 ms (8.3 MiB/s)
4.008 0.052: 35790 bytes read in 39 ms (895.5 KiB/s)
4.013 0.005: ## Booting kernel from Legacy Image at 82000000 ...
4.016 0.003:    Image Name:   Linux-3.14.26
4.020 0.004:    Created:      2015-09-01  10:49:53 UTC
4.025 0.005:    Image Type:   ARM Linux Kernel Image (uncompressed)
4.029 0.004:    Data Size:    2968904 Bytes = 2.8 MiB
4.031 0.002:    Load Address: 80008000
4.033 0.002:    Entry Point:  80008000
4.112 0.079:    Verifying Checksum ... OK
4.116 0.004: ## Flattened Device Tree blob at 88000000
4.120 0.004:    Booting using the fdt blob at 0x88000000
4.182 0.063:    Loading Kernel Image ... OK
4.208 0.026:    Loading Device Tree to 8ef23000, end 8ef2ebcd ... OK
4.215 0.007:
4.217 0.002: Starting kernel ...
4.217 0.000:
5.438 1.221: [    0.585057] cpu cpu0: cpu0 clock notifier not ready, retry
INIT: version 2.88 booting
6.350 0.550: Starting udev
13.265 6.915: ALSA: Restoring mixer settings...
14.997 1.732: Sat Jan  1 01:00:00 UTC 2000
INIT: Entering runlevel: 5
15.734 0.434: Starting ifplugd service for dynamic IP assignment...
15.944 0.210: [   11.092710] net eth0: PHY already attached
15.950 0.006: [   11.097224] net eth0: phy 4a101000.mdio:01 not found on slave 1
16.361 0.411: Starting Dropbear SSH server: dropbear.
16.417 0.055: #################################################################
16.423 0.006: Running ntpdate to fetch current date and time from NTP server
16.429 0.006: ##################################################################
16.461 0.032: Got NTP server, IP: 192.168.82.40
16.612 0.151:  1 Jan 00:00:11 ntpdate[945]: no servers can be used, exiting
16.803 0.191:  1 Jan 00:00:11 ntpdate[948]: no servers can be used, exiting
16.917 0.114:  1 Jan 00:00:11 ntpdate[951]: no servers can be used, exiting
16.923 0.006: Failed to set ntpdate after 3 re-tries!!!
17.591 0.668: Starting syslogd/klogd: done
17.727 0.136: TUNSTALL INIT CONFIGURATIONS START
17.732 0.006: GSM_reset
17.759 0.027: PWM LED CONFIGURATION
17.803 0.044: Vamp_C1 Configuration
17.822 0.019: Vamp_C2 Configuration
17.848 0.026: Stereo codec Configuration
17.871 0.023: Audio amplifier Configuration
17.899 0.028: Monocodec driver configuration
17.965 0.066: BEGINNING OF MAX9860 MONO CODEC CONFIGURATION!!!
18.054 0.089:      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
18.075 0.021: 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18.081 0.006: 10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18.091 0.010: 20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
18.104 0.013: 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18.121 0.017: 40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
18.135 0.015: 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18.141 0.006: 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18.151 0.010: 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
18.216 0.065: 0x40
18.280 0.065: 0x00
18.403 0.123: 0x0a
18.523 0.120: 0x8a
18.660 0.136: 0x24
18.739 0.079: 0x0f
18.844 0.105: 0x20
18.937 0.093: 0x80
19.028 0.092: 0x09
19.109 0.081: 0x00
19.205 0.096: 0x00
19.273 0.068: 0x4a
19.361 0.088: 0x60
19.435 0.074: 0x45
19.530 0.095: 0x00
19.614 0.084: 0x00
19.706 0.092: 0x8a
19.713 0.006: ENDING OF MAX9860 MONO AUDIO VOICE CODEC CONFIGURATION!!!!!
19.948 0.235: Simple mixer control 'DC Filter Enable',0
19.952 0.004:   Capabilities: pswitch pswitch-joined
19.954 0.002:   Playback channels: Mono
19.956 0.002:   Mono: Playback [on]
20.180 0.224: Simple mixer control 'Master',0
20.192 0.011:   Capabilities: pvolume pvolume-joined
20.201 0.009:   Playback channels: Mono
20.203 0.002:   Limits: Playback 0 - 63
20.205 0.002:   Mono: Playback 63 [100%]
20.209 0.004: TUNSTALL INIT CONFIGURATIONS END
22.602 2.393: umount: can't forcibly umount /mnt/.psplash: Invalid argument
22.793 0.191:
22.798 0.005:   ___________
 |____  _____|
     |  |                             |              |    |
     |  |     |    |  |----    ----  ---     ----    |    |
     |  |     |    |  |    |  |____   |      ----|   |    |
     |__|     |____|  |    |   ____|  |___|  |___|_  |_   |_
 2.824 0.000:
Tunstall Project uk.tunstall.com/.../lifeline-vi
22.828 0.000:
Tunstall lifeline Linux-3.14.26 Date : Saturday, 01 January 2000 Time : 00:00:17
22.835 0.000:

^Csrinivasan@srinivasan-Latitude-3440:~$
srinivasan@srinivasan-Latitude-3440:~$ sudo cat /dev/ttyUSB0 | tstamp
    column1 is elapsed time since first message
    column2 is elapsed time since previous message
    column3 is the message
0.000 0.000: 0.004 0.004: U-Boot SPL 2014.07 (Aug 29 2015 - 16:18:34)
1.712 1.708: reading u-boot.img
1.716 0.004: reading u-boot.img
1.779 0.063:
1.779 0.000:
1.783 0.004: U-Boot 2014.07 (Aug 29 2015 - 16:18:34)
1.783 0.000:
1.837 0.054: I2C:   ready
1.838 0.001: DRAM:  256 MiB
1.934 0.096: MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
2.107 0.172: Net:   cpsw, usb_ether
3.115 1.008: Hit any key to stop autoboot:  0
3.130 0.015: Card did not respond to voltage select!
3.142 0.013: Card did not respond to voltage select!
3.146 0.004: checking for valid boot partition .....
3.152 0.005: system boots with normal boot partition 3 ....
3.155 0.003: Saving Environment to MMC...
3.312 0.157: Writing to redundant MMC(1)... done
3.315 0.003: Saving Environment to MMC...
3.471 0.156: Writing to MMC(1)... done
3.534 0.064: switch to partitions #0, OK
3.537 0.003: mmc1(part 0) is current device
3.599 0.062: SD/MMC found on device 1
3.603 0.004: reading uEnv.txt
3.608 0.005: ** Unable to read file uEnv.txt **
3.957 0.349: 2968968 bytes read in 339 ms (8.4 MiB/s)
4.009 0.052: 35790 bytes read in 40 ms (873 KiB/s)
4.014 0.006: ## Booting kernel from Legacy Image at 82000000 ...
4.017 0.003:    Image Name:   Linux-3.14.26
4.021 0.004:    Created:      2015-09-01  10:49:53 UTC
4.026 0.005:    Image Type:   ARM Linux Kernel Image (uncompressed)
4.029 0.004:    Data Size:    2968904 Bytes = 2.8 MiB
4.031 0.002:    Load Address: 80008000
4.034 0.002:    Entry Point:  80008000
4.113 0.079:    Verifying Checksum ... OK
4.116 0.004: ## Flattened Device Tree blob at 88000000
4.120 0.004:    Booting using the fdt blob at 0x88000000
4.183 0.062:    Loading Kernel Image ... OK
4.208 0.026:    Loading Device Tree to 8ef23000, end 8ef2ebcd ... OK
4.215 0.007:
4.217 0.002: Starting kernel ...
4.217 0.000:
5.438 1.221: [    0.585074] cpu cpu0: cpu0 clock notifier not ready, retry
INIT: version 2.88 booting
6.353 0.553: Starting udev
13.403 7.051: ALSA: Restoring mixer settings...
14.899 1.496: Sat Jan  1 01:00:00 UTC 2000
INIT: Entering runlevel: 5
15.720 0.520: Starting ifplugd service for dynamic IP assignment...
15.924 0.204: [   11.072823] net eth0: PHY already attached
15.931 0.006: [   11.077263] net eth0: phy 4a101000.mdio:01 not found on slave 1
16.555 0.625: Starting Dropbear SSH server: dropbear.
16.628 0.072: #################################################################
16.633 0.006: Running ntpdate to fetch current date and time from NTP server
16.639 0.006: ##################################################################
16.647 0.008: Got NTP server, IP: 192.168.82.40
16.807 0.160:  1 Jan 00:00:11 ntpdate[948]: no servers can be used, exiting
16.978 0.171:  1 Jan 00:00:11 ntpdate[951]: no servers can be used, exiting
17.126 0.148:  1 Jan 00:00:11 ntpdate[954]: no servers can be used, exiting
17.137 0.011: Failed to set ntpdate after 3 re-tries!!!
17.807 0.671: Starting syslogd/klogd: done

17.949 0.006: GSM_reset
17.986 0.037: PWM LED CONFIGURATION
18.007 0.021: Vamp_C1 Configuration
18.049 0.042: Vamp_C2 Configuration
18.071 0.023: Stereo codec Configuration
18.116 0.045: Audio amplifier Configuration
18.154 0.038: Monocodec driver configuration
18.514 0.361: Simple mixer control 'DC Filter Enable',0
18.518 0.004:   Capabilities: pswitch pswitch-joined
18.520 0.002:   Playback channels: Mono
18.522 0.002:   Mono: Playback [on]
18.848 0.326: Simple mixer control 'Master',0
18.852 0.004:   Capabilities: pvolume pvolume-joined
18.861 0.010:   Playback channels: Mono
18.864 0.002:   Limits: Playback 0 - 63
18.866 0.002:   Mono: Playback 63 [100%]

  • Dear Biser,

    Thanks a lot for your inputs

    1. W.r.t the file systems optimization the above link says that udev can be replaced with mdev, Could you please let me know how this can be done in arago-base-tisdk-image-am335x-evm in ti sdk 8 (I googled a few but it was bits & pieces) with detailed steps & please let me know is there any harm in using mdev (as in my product, I would be using USB as one of the hot pluggable devices)


    2. As am newbie to rootfs I need some brief explanation w.r.t the below scripts, once if I get better understanding, I can try to remove which ever the below is not required in the /etc/init.d/

    alignment.sh
    banner.sh
    bootmisc.sh
    checkroot.sh
    modutils.sh
    mountall.sh
    populate-volatile.sh
    psplash.sh
    read-only-rootfs-hook.sh
    urandom
    modutils.sh


    3. And how to disable the login ie., preventing it to enter the password

    4. To reduce the time creation of shell

    5. How to build uncompressed kernel Image & load it from EMMC


    Kindly do the needful as early as possible

    Many Thanks in advance

  • Hi, 

    1).

    Srini said:
    1. W.r.t the file systems optimization the above link says that udev can be replaced with mdev, Could you please let me know how this can be done in arago-base-tisdk-image-am335x-evm in ti sdk 8 (I googled a few but it was bits & pieces) with detailed steps & please let me know is there any harm in using mdev (as in my product, I would be using USB as one of the hot pluggable devices)

    I am not sure that this has been tested with AM335x arago-project filesystem. From what I understood during my research on mdev, you should be able to use it instead of udev. Here is a guide I found: 
     https://wiki.gentoo.org/wiki/Mdev 

    However, I cannot provide a step-by-step guide, because as I said, I don't think that this has been officially verified on the TI SDK.

    2). These are init scripts that run on different runlevels, depending on their location rcX.d 

      modutils - loads the modules listed in /etc/modules

      alignment.sh - echo 3 > /proc/cpu/alignment  makes linux fixup the instruction and provide some dmesg output, basically useful for unaligned memory processes

      checkroot -> this is a Check to root file system, see script code for more info. 

      bootmisc -> handles misc processes on startup, i.e.: put a nologin file in /etc to prevent people from logging in before  system startup is complete; Set pseudo-terminal access permissions; Apply /proc settings if defined etc... 

       mountall -> Mount all filesystems

       populate-volatile -> Populate the volatile filesystem

       psplash ->  enables the TI boot logo & process bar

    Basically if you have a look at the code of each script you'll get the idea of what it's doing.

    3). Currently the Arago filesystem for AM335x devices does not require password. 

    4). You could disable debug prints, remove the countdown between u-boot & kernel, you can even use falcon mode to skip u-boot stage & load kernel directly after MLO. 

    5). run make uImage. Modify the u-boot environment variables to search for uImage instead of zImage. 

    Best Regards, 

    Yordan

  • Dear Yordan,

    Many Thanks a lot for your prompt responses & was really helpfull & would really appreciate the same

    I have few more related to Network security & optimization, could you please let me know the following can be accomplished

    -          Shell access only in debug build only(if we plan to continue existing support). Even here it should never login as root if possible, or disable root login

     Confirm that only the absolutely required ports are open (use netstat -tulpn)

    -          Turn off IPv6 if not using it

    -          Keep /boot read-only

    nables via sysctl (to be done in init script, or can be defaults in sysctl file)
    -          Disable net.ipv4.ip_forward ( may need CONFIG_IP_FORWARD to be enabled in kernel config)
    -          Enable Source Route Verification (IP spoofing protection): net.ipv4.conf.*.rp_filter=1
    -          Disable IP source routing via net.ipv4.conf.*.accept_source_route=0
    -          Disable ICMP redirects via net.ipv4.conf.*.accept_redirects=0
    -          Ignore ICMP echo broadcasts via net.ipv4.icmp_echo_ignore_broadcasts=1
    -          Ignore ICMP bogus error responses via net.ipv4.icmp_ignore_bogus_error_response=1
    -          Enable logging of martian packets via net.ipv4.conf.*.log_martians=1.
    -          Enable TCP SYN Cookie Protection via net.ipv4.tcp_syncookies=1 and proper values for  net.ipv4.tcp_max_syn_backlog, net.ipv4.tcp_synack_retries and net.ipv4.tcp_abort_on_overflow (may need CONFIG_SYN_COOKIES to be enabled in kernel config)
    -          Enable exec-shield protection against buffer overflows: kernel.exec-shield = 1 and kernel.randomize_va_space = 1 (Check if this is really available in the SDK version)

    Kindly do the needful as early as possible

    Many Thanks in advance