2009-06-26 13:26:33 fw_env.config
Rob Maris (GERMANY)
Message: 76399
upon today's SVN update, I encounter a problem with my fw_env.config right in the vendor/..../boardxxx subdirectory where I have put it together with other files which are copied to romfs due to makefile entries.
However, following change exhibits a problem:
Revision 8259 - (download) (annotate)
Wed Jun 10 03:21:32 2009 UTC (2 weeks, 2 days ago) by rgetz
File size: 288 byte(s)
Make sure we install the defualt fw_env.config for save/print
The problem: a default fw_env.config in user/blkfin-apps/uboot-tools will be written AFTER writes from the makefile in the vendor subdirectory (e.g. with make or make romfs).
So, this change in Rev. 8259 is only okay when both writes to romfs/etc/... are in reversed order.
-Rob
QuoteReplyEditDelete
2009-06-26 13:39:57 Re: fw_env.config
Robin Getz (UNITED STATES)
Message: 76401
Rob:
I guess the short answer is don't user our vendor files, and make your own...
The long answer is I can revert things, and do it in the romfs step.
-Robin
QuoteReplyEditDelete
2009-06-26 13:47:42 Re: fw_env.config
Rob Maris (GERMANY)
Message: 76403
Robin,
why should I not use vendor files? I think the correct place for fw_env.config is the same place where rc and eventually profile, crontab etc. reside. Or would you recommend another place?
-Rob
QuoteReplyEditDelete
2009-06-26 14:14:31 Re: fw_env.config
Robin Getz (UNITED STATES)
Message: 76406
Rob:
Sorry I was not clear - you should be using your own vendor files - not the Analog Devices ones.
-Robin
QuoteReplyEditDelete
2009-06-26 16:23:57 Re: fw_env.config
Rob Maris (GERMANY)
Message: 76409
Robin, perhaps I'm not clear, too...
When I say vendor file, and my board is a bluetechnix tcm-bf537, then my fw_env.config resides in
.../uClinux_2.6.4/trunk_new_test/vendors/Bluetechnix/TCM-BF537,
along with rc etc (I keep two parallel trunks, which I update alternatively, and rename if updates are okay).
This is not an Analog Devices file, at most an Analog Devices file may have had the purpose of template file.
Now this file is overwritten in romfs/etc by the default file in the *generic* directory uboot-tools.
My problem is solely the (in my opinion wrong order of things in make (romfs). Should first write any defaults, and if present, overwrite with a specific file.
-Rob
QuoteReplyEditDelete
2009-06-26 21:40:32 Re: fw_env.config
Robin Getz (UNITED STATES)
Message: 76414
Rob:
Sorry - I misunderstood the question/answer. My fault.
My understanding is that the romfs does things in this order (as an example - the BF537-STAMP)
- romfs target in ./vendors/AnalogDevices/BF537-STAMP/Makefile
- romfs target in user/blkfin-apps/u-boot-tools/env/Makefile will be run
If you want to override an specific config file, put it in the ./vendors/AnalogDevices/BF537-STAMP/Makefile romfs.post target.
Does that make sense?
-Robin
QuoteReplyEditDelete
2009-06-27 13:49:20 Re: fw_env.config
Rob Maris (GERMANY)
Message: 76431
After doing some experiments, I had success with following change (extract of makefile)
all::
romfs.post:: romfs.shared.libs
$(ROMFSINST) /etc/fw_env.config
romfs::
mkdir -p $(ROMFSDIR)
cd $(ROMFSDIR) && mkdir -p $(ROMFS_DIRS-y)
chmod 1777 $(ROMFSDIR)/tmp
$(ROMFSINST) -s bin /sbin
$(ROMFSINST) /etc/rc
$(ROMFSINST) /etc/mdev.conf
$(ROMFSINST) /etc/inittab
$(ROMFSINST) /etc/config/root
$(ROMFSINST) /etc/profile
set -e ; \
for f in $(ETC_FILES-y) ; do \
$(ROMFSINST) ../common/$$f /etc/$$f ; \
done
echo "$(VERSIONSTR) -- `date`" > $(ROMFSDIR)/etc/version
My first try was to outcomment the romfs:: line. It works, but this would probably have undesired side effects as to do a lot as post process.
Then I moved the line with fw_env.config as a single entry in the post target. This has the desired effect, too. I believe this is exactly that what you, Robin, has intended to propose. However, I believe it would make sense to move other ROMFSINST lines also to the .post target. Any future default file would then not destroy my customized file. Your opinion?
-Rob
QuoteReplyEditDelete
2009-06-27 13:59:58 Re: fw_env.config
Robin Getz (UNITED STATES)
Message: 76432
Rob:
I don't think that anything in ./user will over-write any of the standard /etc files - (Althought that is where some of the extra ones should go - like -- the /etc/directfbrc or others in the 548 config).
Mike - thoughts?
-Robin
QuoteReplyEditDelete
2009-06-29 02:10:36 Re: fw_env.config
Mike Frysinger (UNITED STATES)
Message: 76445
typically things in user/ use the -a option when touching files in /etc/ so that things dont get clobbered
QuoteReplyEditDelete
2009-06-29 12:29:55 Re: fw_env.config
Rob Maris (GERMANY)
Message: 76475
I have compared the example with directfbrc. Herewith Robin confirms that there, under ./vendors/ such files should reside. Alas, no "default" copy of this file is found in a ./user/ directory, and thus also not referred to in a local makefile.
I'd appreciate it when Mike could explain the -a option (and where it should be placed) in a bit more detail. I believe he means that it takes care of not overwriting an already existing file in /romfs. This would also prevent overwriting by any default file.
Lastly I hope that the effort of this thread will contribute to more consistence in the distribution "policy".... (reverting the change two weeks ago), or my solution with romfs.post or the -a option)
-Rob
QuoteReplyEditDelete
2009-06-29 12:37:18 Re: fw_env.config
Mike Frysinger (UNITED STATES)
Message: 76478
./tools/romfs-inst.sh 2>&1 | grep -e-a
the user/blkfin-apps/u-boot-tools/env/Makefile should only install /etc/fw_env.config if it doesnt already exist. vendor Makefiles however should always install files regardless of them existing in the romfs dir already.
QuoteReplyEditDelete
2009-06-30 03:22:14 Re: fw_env.config
Rob Maris (GERMANY)
Message: 76499
The given command line shows an extract of "usage" when I'm in the trunk root. However, the -a option is not specified as "do not write file if it already exists".
Further, Mike's remark regarding the intended behaviour about files preserving/overwriting are a clear statement, which helps me to do the correct steps. According to the desired behaviour, the (updated) uboot-tools makefile as referred to on top of this thread posesses an error. I don't find an option in romfs-inst.sh that preserves an already existing file.
In order as not to destroy the intention of having default files in /user, I still have this arrangement in my vendor makefile:
romfs.post:: romfs.shared.libs
$(ROMFSINST) /etc/fw_env.config
-Rob
QuoteReplyEditDelete
2009-06-30 13:14:51 Re: fw_env.config
Mike Frysinger (UNITED STATES)
Message: 76533
should probably add a new romfs-inst.sh flag, otherwise the u-boot code would have to read:
test -e $(ROMFSDIR)/etc/fw_env.config || $(ROMFSINST) -d /etc/fw_env.config