20170703_jeffrey - silenceuncrio/diary GitHub Wiki

0920

公司裁員後第一個月的第一天

目前我掛在 BUSINESS UNIT II 成員如下

  • 處長 - 陳金勇(兼) jim
  • 研發資深經理 - 張偉玉 ariel
  • 研發資深經理 - 賴惠程 morris
  • 研發經理 - 田名琳 john
  • 研發副理 - 李綜益 jeffrey
  • 業務副理 - 徐秀珍 cindy
  • 軟體研發工程師 - 王辰佑 aaron
  • 資深測試工程師 - 黃柏蒼 borchen

可以說是 M300 原班人馬

0935

這禮拜要幫 john 在 release/v1.51 上實作 TR069 的 WEB UI

john 已經有準備了 wiki - CWMP

0945

在等待 john 把 icos module 寫好之前我要先時做我負責的 VRRP icos module

實做的 branch 在 feature/vrrp

參考之前實做 DMZ 時的紀錄 - add dmz feature

先讓 proscend 目錄下的 make menuconfig 能夠針對 VRRP 功能來做開關

commit 56a694c634f1ca180b12a7b0b98c176274d987cf                                                        
Refs: [feature/vrrp]                                                                                   
Author: jeffrey <[email protected]>                                                                 
Date:   Mon Jul 3 10:03:42 2017 +0800                                                                  

    'VRRP' ICOS Module implementing
    - let the proscend 'make menuconfig' recognize it

 proscend/mconfig/Config.in                        | 1 +                                               
 proscend/mconfig/configs/M300/0_GENERIC/defconfig | 2 ++                                              
 proscend/mconfig/configs/M300/1_GPS/defconfig     | 2 ++                                              
 3 files changed, 5 insertions(+)

1025

參考 first step of dmz implementation

開始新增 VRRP ICOS Module

1315

morris 問到 i.MX6UL 是否支持 eMMC 5.0

我在 NXP 論壇 survey 到

i.MXUL Boot mode can support eMMCv4.4 or less.

The eMMC should be backwards compatible (as long as they comply with the eMMC standard you should be okay) and it would work on 4.4 mode, which may not take advantage of newer features, just keep that in mind.

已經口頭告知 morris 說 i.MX6UL 是支持 eMMC 5.0 的

1545

今天的月會氣氛格外沉重

組織改變後的第一天 加上 第一個月會

還有很多過往的流程需要調整的地方

  • 週報交給誰
  • 假卡誰簽
  • 福委補選
  • 品保相關流程

1740

vrrp icos module 在 apply 的時候需產生 keepalived 需要的 configuration file

做法可以參考 dhcp icos module 的 _gen_daemon_file()

dhcpcfg.c

static int _gen_daemon_file(char *filename, sDhcpConfig *p_dhcp, sLanIpv4 *p_lan, PROTO4INFO_T *wan_info)
{
    if (!filename || !p_dhcp || !p_lan)
    {
        return ICOS_FAILURE;
    }

    FILE *fp = fopen(filename, "wt");

    if (fp == 0)
    {
        _LOG_ERROR("Failed to open file: '%s'", filename);
        return ICOS_FAILURE;
    }

    char ipv4_net_str[IP_MAX_LEN], ipv4_mask_str[IP_MAX_LEN];
    U32 ipv4_net = (p_lan->addr & p_lan->mask);

    IPv42String(&ipv4_net, ipv4_net_str);
    IPv42String(&(p_lan->mask), ipv4_mask_str);

    fprintf(fp, DHCPD_CONF_SUBNET_FORMAT" {\n", ipv4_net_str, ipv4_mask_str);

    int pool_index, pool_dns_index, fixip_index;
    for (pool_index = 0; pool_index < DHCP_POOL_NUM; pool_index++)
    {
        sDhcpPool *current_pool = &(p_dhcp->pool[pool_index]);

        if (current_pool->ipv4_start == 0 || current_pool->ipv4_start == IPV4_NULL)
        {
            continue;
        }

        if (current_pool->ipv4_end == 0 || current_pool->ipv4_end == IPV4_NULL)
        {
            continue;
        }

        if (!_is_pool_in_subnet(current_pool, p_lan))
        {
            continue;
        }

        char *dns = malloc(sizeof(char) * IP_MAX_LEN);

        if (dns)
        {
            IPv42String(&(p_lan->addr), dns);
        }
        else
        {
            return ICOS_FAILURE;
        }

        char start[IP_MAX_LEN], end[IP_MAX_LEN], gw[IP_MAX_LEN];

        IPv42String(&(current_pool->ipv4_start), start);
        IPv42String(&(current_pool->ipv4_end), end);
        IPv42String(&p_lan->addr, gw);

        fprintf(fp, DHCPD_CONF_POOL_FORMAT,
                start, end,
                gw,
                dns,
                current_pool->leasetime * 60,
                DHCPD_CONF_MAX_LEASE_TIME
               );

        if (dns)
        {
            free(dns);
        }
    }

    fprintf(fp, "}");

    fflush(fp);
    fclose(fp);

    return ICOS_SUCCESS;
}