/* save a copy for init‘s usage during boot */
strlcpy(bootmode, property_get("ro.bootmode"), sizeof(bootmode));
/* if this was given on kernel command line, override what we read
* before (e.g. from /proc/cpuinfo), if anything */
// 获取ro.boot.hardware属性的值
pval = property_get("ro.boot.hardware");
if (pval)
// 这里通过ro.boot.hardware属性再次改变hardware变量的值
strlcpy(hardware, pval, sizeof(hardware));
// 利用hardware变量的值设置设置ro.hardware属性
// 这个属性就是前面提到的设置初始化文件名的属性,实际上是通过hardware变量设置的
property_set("ro.hardware", hardware);
/* TODO: these are obsolete. We should delete them */
if (!strcmp(bootmode,"factory"))
property_set("ro.factorytest", "1");
else if (!strcmp(bootmode,"factory2"))
property_set("ro.factorytest", "2");
else
property_set("ro.factorytest", "0");
}