ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] Adding YAFFS2 deployment to LTIB (as well as elf file generat


From: Peter Barada
Subject: Re: [Ltib] Adding YAFFS2 deployment to LTIB (as well as elf file generation of result)
Date: Mon, 09 Nov 2009 14:01:57 -0500

On Mon, 2009-11-09 at 12:43 -0500, Peter Barada wrote:
On Sat, 2009-11-07 at 11:54 -0500, Peter Barada wrote:
On Sat, 2009-11-07 at 10:03 +0000, Stuart Hughes wrote:
Hi Peter,

Before checking this in and uploading the yaffs patch to the GPP I 
wanted to let you check some changes I made.  I've attached the modified 
patches.  Here's some comments:

* In both your patches I stripped the \r from the line endings, so that 
they are now just \n.  For future patches please try to avoid \r as for 
C code in particular if they get in they can cause problems.

Sorry about that, Emacs hides the line endings so I didn't see that the files I patched had \r in them.

* In your patches I removed real tabs in favour of spaces (just a 
preference, I wanted to stay consistent).

Yup.

* I've added a comment out section in .ltibrc to show how to use the 
use_localtime feature.

Yup.

* I bumped up the host_wait_warning number in .ltibrc to force a 
re-evaluation of host packages (so people who update will build the 
updated yaffs).

Yup.

* In deployment.lkc I made the date-stamping of the elf image optional 
(DEPLOYMENT_ELF_DATESTAMP), I reflected this in Ltibutils.pm
Yup.

* In yaffs-utils.spec I bumped up the revision number in case people 
already have BSPs with yaffs enabled, this will make sure the newer 
versions supersedes the old and gets installed.
Yup.
* In yaffs_utils-20060418-mkyaffs2image.patch I removed the bogus 
'binary files .. differ' and xxx~ diffs.  I also added a pre-amble to 
state the origin.
Yup.  What I should add to that Makefile is a "distclean" to strip out the
binary files...

Can you review these changes (test if possible) and let me know if okay 
to commit.  Also can you confirm that for the 
yaffs_utils-20060418-mkyaffs2image.patch you are the originator (or 
where the changes came from) and confirm they're freely distributable so 
that I can add this when I upload to the GPP.

The add-yaffs patch incorporates code from mkfs.jffs2(which is under GPL), as well as my own work.  As such, my changes are freely distributable.

I'll incorporate your changes, build and test.  Then I'll send back a replacement add-yaffs patch that fixes up the Makefile to strip out the binaries, as well as add GPL to the added files.

I'll have something for you by Monday.

Stuart,

Attached is a new yaffs-utils-20060418-mkyaffs2image.patch and yaffs-utils.spec that:

1) Adds in GPL headers to the appropriate files
2) Gives attribution to creaters of mkfs.jffs2 for dev_table.c
3) Adds distclean in new top-level makefile
4) Cleans up warnings.
5) Fixes problem of device table entries becoming hardlinks to themselves if they already existed in the rootfs.

Since I had a previous mkfs.yaffs2 in my /opt/ltib/usr/bin directory, I removed it, and the host build stage does not install /opt/ltib/usr/bin/mkfs.yaffs2.  I tried to force that by removing .host_wait_warning33, as well as /opt/ltib/usr/src/rpm/RPM/x86_64/yaffs-utils-20060418-2.x86_64.rpm, then running "./ltib -p sysconfig -m scdeploy" to force a deployment.  the host_config.log is attached, and I poked at the created RPM file and see:

address@hidden rpm2cpio /opt/ltib/usr/src/rpm/RPMS/x86_64/yaffs_utils-20060418-2.x86_64.rpm | cpio -t
./opt/freescale/rootfs/x86_64/opt
./opt/freescale/rootfs/x86_64/opt/ltib
./opt/freescale/rootfs/x86_64/opt/ltib/usr
./opt/freescale/rootfs/x86_64/opt/ltib/usr/bin
./opt/freescale/rootfs/x86_64/opt/ltib/usr/bin/mkfs.yaffs
./opt/freescale/rootfs/x86_64/opt/ltib/usr/bin/mkfs.yaffs2
116 blocks
address@hidden 

The output looks very similar to the genromfs-0.5.1-1.x86_64.rpm output (namely that genromfs is in "./opt/freescale/rootfs/x86_64/opt/ltib/usr/bin").

I've tested mkfs.yaffs2 by hand that it looks to produce the right stuff - no hard test as I don't have an x86_64 version in /opt/ltib/usr/bin...

Any ideas what can be happening?

Nevermind.  Since I changed the target form mkyaffs2image to mkfs.yaffs2, and this was done after you kicked up the revision, RPM didn't think it had to resinstall since that version was already installed (or so I'm thinking).  If I moved /usr/ltib/{var,src} out of the way, it rebuild/reinstalled everything, including mkfs.yaffs2.

Thanks for your help.

More than welcome - LTIB makes my work a whole lot easier. :)


Regards, Stuart

Peter Barada wrote:
> On Fri, 2009-11-06 at 17:29 +0000, Stuart Hughes wrote:
>> Hi Peter,
>>
>> If you can send me a new patch that would help.  A flag in .ltibrc to 
>> indicate times are local would be fine, the default (no entry at all) 
>> should be to GMT (UTC).
> 
> Attached.
> 
> 1) re-factored ELF generation.
> 
> 2) Fixes the absolute prefixing to only apply when creating symbolic 
> link in rpm/SOURCES/
> 
> 3) Added flag in .ltibrc to modify gm_yyyymmdd() to return localtime IFF 
> flag %use_localdir is set and non-zero.  My perl foo is not super stong 
> so I brute-forced it.
> 
> Example flag usage in .ltibrc:
> 
> # If %use_localtime is set, and non-zero, then timestamps are in localtime, not GMT
> %use_localtime
> 1
> 
> 
>> Regards, Stuart
>>
>> Peter Barada wrote:
>> > On Fri, 2009-11-06 at 16:07 +0000, Stuart Hughes wrote:
>> >> Hi Peter,
>> >>
>> >> I understand your reluctance to use UTC (GMT), but I still think in the 
>> >> log run that will cause less confusion.  If you just want a timestamp, 
>> >> who about using the 'time' seconds since the epoch?  Anyhow I can 
>> >> foresee many issues if you use localtime, so  although there's no 
>> >> right/wrong wrt it would please me to go with something based on UTC.
>> > I understand the implications of using localtime, especially if 
>> > development is spread out across timezones.  Seconds since epoch would 
>> > certainly work, but is quite cumbersome for users I distribute images to 
>> > that don't understand how to convert back-n-forth from localtime.
>> > 
>> > In my case the granularity is only to a day, and isolated to the stamp 
>> > on the file so I wouldn't expect much problem with it.
>> > 
>> > As a compromise, would a patch that adds/uses a flag to .ltibrc to 
>> > specify whether timestamps are in localtime or GMT be acceptable?  Then 
>> > the default can be GMT and users can choose which time refernce they 
>> > want to use.....
>> > 
>> >> For now I'll apply your proposed change to add $top to relative paths, 
>> >> lets see if there is any fallout (regressions) and if so deal with it then.
>> > As I'm the only one (apparently) who needs this, lemme look at fixing 
>> > the symbolic link creation in rpm/SOURCES instead.  I'll get you 
>> > something over the weekend.
>> > 
>> >> I will re-factor deployment.lkc as discussed (as time permits).
>> > 
>> > If you want, I can re-factor and resubmit the change....
>> > 
>> >> Regards, Stuart
>> >>
>> >> Peter Barada wrote:
>> >> > On Fri, 2009-11-06 at 09:13 +0000, Stuart Hughes wrote:
>> >> >> Hi Peter,
>> >> >>
>> >> >> Thanks for the patches.  I need to take a closer look (maybe over the 
>> >> >> w/e) but here's some initial comments/questions for you:
>> >> >>
>> >> >> ---+ bin/Ltibutils.pm
>> >> >>
>> >> >> I don't like the idea of using localtime as timestamps when making ELF 
>> >> >> images.  The reason is this will confuse people as it's inconsistent 
>> >> >> with all other timestamps used in LTIB and also without a timezone it 
>> >> >> can't be given an absolute reference.  I'd advise switching to gm_yyyymmdd.
>> >> > 
>> >> > In my timezone (GMT+5), its quite aggravating to do a build a 6:59pm and 
>> >> > get one date, but then a build at 7:01pm produces tomorrows date.  The 
>> >> > date is only used in the ELF image name to stamp it.
>> >> > 
>> >> > The reason for the date is so ELF images I create are anchored by date 
>> >> > which makes it much easier to track when bugs pop up (by bisecting tests 
>> >> > using all images to date(thanks to really cheap disc space!)) as well as 
>> >> > easily have developers/users "keep up" with feature additions.
>> >> > 
>> >> > The only place gm_yyyymmdd() is used is in Ltibrelease.pm::release_main.
>> >> > The same functionality (i.e. calling gmtime) is replicated in multiple 
>> >> > places (autobuild, listpkginfo, mk_pkg_results).
>> >> > 
>> >> >> I think prefixing relative paths with $top in parse_config is probably 
>> >> >> okay, but I'm surprised it is needed as ltib is always run from the top 
>> >> >> directory?  Even if it doesn't do any harm, I'm a bit worried that this 
>> >> >> could break other configs if they run from a different directory and 
>> >> >> assume that current working directory.  (I can't remember if anything 
>> >> >> else uses this function).
>> >> > In my %ldirs I have:
>> >> > 
>> >> > /var/ltmp/pkgs
>> >> > /opt/freescale/pkgs
>> >> > my-package-pool
>> >> > 
>> >> > and if I have the yaffs_utils-20060418-mkyaffs2image.patch patch in 
>> >> > my-package-pool, and w/o the change to prefix the relative path,  adding 
>> >> > a print of $getcwd() and $path right before the "if (-f $path) {" 
>> >> > statement in get_file(), then I see the following output:
>> >> > 
>> >> > address@hidden:~/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102$ ./ltib -p yaffs-utils.spec -m prep
>> >> > 
>> >> > Processing: yaffs-utils
>> >> > =========================
>> >> > Build path taken because: build key set, no prebuilt rpm, 
>> >> > pwd: /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102 path: /opt/ltib/pkgs/yaffs_utils-20060418-mkyaffs2image.patch
>> >> > pwd: /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102 path: /var/tmp/pkgs/yaffs_utils-20060418-mkyaffs2image.patch
>> >> > pwd: /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102 path: /opt/freescale/pkgs/yaffs_utils-20060418-mkyaffs2image.patch
>> >> > pwd: /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102 path: my-package-pool/yaffs_utils-20060418-mkyaffs2image.patch
>> >> > Testing network connectivity
>> >> > OK GPP: 
>> >> > 
>> >> > Try yaffs_utils-20060418-mkyaffs2image.patch.md5 from the GPP
>> >> > http://bitshrine.org/gpp/yaffs_utils-20060418-mkyaffs2image.patch.md5:
>> >> > 10:23:48 ERROR 404: Not Found.
>> >> > WARN: skipping md5sum check for lpd-IP-package-pool/yaffs_utils-20060418-mkyaffs2image.patch, md5 file was not found
>> >> > 
>> >> > rpmbuild --dbpath /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102/rootfs//var/lib/rpm --target arm --define '_unpackaged_files_terminate_build 0' --define '_target_cpu arm' --define '__strip strip' --define '_topdir /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102/rpm' --define '_prefix /usr' --define '_tmppath /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102/tmp' --define '_rpmdir /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102/rpm/RPMS'  --define '_mandir /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir /var' -bp  /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102/dist/lfs-5.1/yaffs-utils/yaffs-utils.spec
>> >> > Building target platforms: arm
>> >> > Building for target arm
>> >> > error: File /home/peter/work/logic/svn/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102/rpm/SOURCES/yaffs_utils-20060418-mkyaffs2image.patch: No such file or directory
>> >> > Build time for yaffs-utils: 0 seconds
>> >> > 
>> >> > Failed building yaffs-utils
>> >> > 
>> >> > 
>> >> > f_prep() returned an error, exiting
>> >> > traceback:
>> >> >  main:561
>> >> > 
>> >> > Exiting on error or interrupt
>> >> > 
>> >> > 
>> >> > so get_file works fine w/o the change.  The failure is because  
>> >> > rpm/SOURCES/yaffs_utils-20060418-mkyaffs2image.patch is a symbolic link 
>> >> > to "my-package-pool/yaffs_utils-20060418-mkyaffs2image.patch" using a 
>> >> > relative path, which causes rpm to fail as the symbolic link is valid 
>> >> > IFF the cwd (when accessing that file) is the top-level LTIB directory.  
>> >> > I think rpm changes its working directory to "rpm/BUILD" which would 
>> >> > cause accessing that file to fail....
>> >> > 
>> >> > I'll look at prefixing $top in the symbolic link creation, not in 
>> >> > get_file itself and see what happens in my LTIB usage....
>> >> > 
>> >> > 
>> >> >> ---+ config/userspace/deployment.lkc
>> >> >>
>> >> >> I can see what you're doing with the logic for primary deployment style 
>> >> >> + elf.  If I understand correctly if your platform has an elf capability 
>> >> >> then you want to build that as well as your primary choice.  If so then 
>> >> >> I think it would be better to re-factor this.  Put it back as was, add 
>> >> >> yaffs2 to the 'root filesystem image type' choice-list and add a new 
>> >> >> independent section below it like this:
>> >> >>
>> >> >> if CAP_DEPLOYMENT_ELF && (DEPLOYMENT_JFFS2
>> >> >>         || DEPLOYMENT_YAFFS2
>> >> >>         || DEPLOYMENT_RAMDIS)
>> >> >> config DEPLOYMENT_ELF
>> >> >>         bool "build an combined elf image"
>> >> >> endif
>> >> >>
>> >> >> If you agree I can make that change.
>> >> > 
>> >> > Yes, on my platform I want to optionally build the ELF file as well as 
>> >> > the rootfs, and in the case of a ramdisk, combine it into the ELF file 
>> >> > (as the other rootfs images would reside on non-volatile storage).
>> >> > 
>> >> > Your refactoring makes perfect sense to me.
>> >> > 
>> >> >> Aside from that it looks okay so far.
>> >> >>
>> >> >> Regards, Stuart
>> >> >>
>> >> >>
>> >> >> Peter Barada wrote:
>> >> >> > Stuart,
>> >> >> > 
>> >> >> > The attached patch adds YAFFS2 as a deployment method to the current 
>> >> >> > LTIB (actually LTIB as checked out 20091102), as well as patches to 
>> >> >> > yaffs-utils-20060418 to allow for mkfsyaffs2image to be built and take 
>> >> >> > args that allow a device table.
>> >> >> > 
>> >> >> > I've purposely left the original mkyaffsimage code alone (and did not 
>> >> >> > add a YAFFS deployment method) as I don't have a target with small-block 
>> >> >> > NAND to test that functionality with, but it should be failry simple to add.
>> >> >> > 
>> >> >> > The patch to deployment.lkc and bin/Ltibutils.pm also adds in ELF 
>> >> >> > support, as in have LTIB create an ELF file of the resultant 
>> >> >> > u-boot/kernel or u-boot/kernel/ramdisk using a Makefile in 
>> >> >> > config/platform/__platform__/elf-image, and the ELF creation capability 
>> >> >> > is enabled if the platform's main.lkc contains:
>> >> >> > 
>> >> >> > # Can deploy an ELF image.
>> >> >> > config CAP_DEPLOYMENT_ELF
>> >> >> >     bool
>> >> >> >     default y
>> >> >> > 
>> >> >> > 
>> >> >> > If this capability is not present then the code should act as it does 
>> >> >> > now (with the addition of creation of a YAFFS2 rootfs image).  My target 
>> >> >> > has LoLo as its boot loader, so to boot linux I need to load 
>> >> >> > u-boot/kernel and exec u-boot (which then uses bootm witht he address of 
>> >> >> > where the kernel was loaded as part of the ELF file) so I need the ELF 
>> >> >> > deployment method.  I can provide the Makefile/utilities for my target 
>> >> >> > to link together u-boot/kernel/rootfs into a single ELF file if anyone 
>> >> >> > is interested.
>> >> >> > 
>> >> >> > I've been thinking about the sector/spare/erase size configuration for 
>> >> >> > YAFFS (and the erase size for JFFS2), and I'm starting to convince 
>> >> >> > myself that these variables should be in a platform's main.lkc as 
>> >> >> > constants.  The patch to yaffs-utils doesn't have any sector/page/block 
>> >> >> > size information in it, I'll generate that later and have mkyaffs2image 
>> >> >> > take advantage of it.
>> >> >> > 
>> >> >> > Hopefully people will find this useful.
>> >> >> > 
>> >> >> > -- 
>> >> >> > Peter Barada <address@hidden <mailto:address@hidden> <mailto:address@hidden> <mailto:address@hidden> <mailto:address@hidden>>
>> >> >> > Logic Product Development, Inc.
>> >> >> > 
>> >> > -- 
>> >> > Peter Barada <address@hidden <mailto:address@hidden> <mailto:address@hidden> <mailto:address@hidden>>
>> >> > Logic Product Development, Inc.
>> >> > 
>> > -- 
>> > Peter Barada <address@hidden <mailto:address@hidden> <mailto:address@hidden>>
>> > Logic Product Development, Inc.
>> > 
> -- 
> Peter Barada <address@hidden <mailto:address@hidden>>
> Logic Product Development, Inc.
> 
--
Peter Barada <address@hidden>
Logic Product Development, Inc.
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/ltib
--
Peter Barada <address@hidden>
Logic Product Development, Inc.
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/ltib
--
Peter Barada <address@hidden>
Logic Product Development, Inc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]