Page MenuHomeFreeBSD

makefs: Provide a -T option to set timestamps to a consistent value
ClosedPublic

Authored by emaste on Jun 13 2016, 5:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 5:11 PM
Unknown Object (File)
Thu, Nov 21, 5:11 PM
Unknown Object (File)
Thu, Nov 21, 5:10 PM
Unknown Object (File)
Thu, Nov 21, 4:43 PM
Unknown Object (File)
Wed, Nov 20, 12:46 PM
Unknown Object (File)
Mon, Nov 18, 3:33 PM
Unknown Object (File)
Mon, Nov 18, 12:24 AM
Unknown Object (File)
Sun, Nov 17, 5:20 AM
Subscribers

Details

Summary

Obtained from NetBSD

usr.sbin/makefs/ffs/mkfs.c 1.66
usr.sbin/makefs/ffs/newfs_extern.h 1.33
usr.sbin/makefs/cd9660.c 1.50 1.51
usr.sbin/makefs/ffs.c 1.65 1.68
usr.sbin/makefs/makefs.8 1.54
usr.sbin/makefs/makefs.c 1.51
usr.sbin/makefs/makefs.h 1.36
usr.sbin/makefs/walk.c 1.29

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste retitled this revision from to makefs: Provide a -T option to set timestamps to a consistent value.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added subscribers: pfg, cem, ngie.
usr.sbin/makefs/cd9660.c
622 ↗(On Diff #17560)

(pedant hat on) this introduces a style(9) bug.

879 ↗(On Diff #17560)

Could this duplicated logic be hidden behind a macro? E.g.,

#define REPRODUCIBLE_TIMESTAMP(default) (stampst.st_ino ? stampst.st_mtime : (default))

...

cd9660_time_915(..., REPRODUCIBLE_TIMESTAMP(node->inode->st.st_mtime));
usr.sbin/makefs/ffs.c
546 ↗(On Diff #17560)

I don't understand this logic given we only set st_ino = 1 when a numeric timestamp is provided, rather than a reference file. Don't we want to treat reference files identically to numerically provided timestamps?

usr.sbin/makefs/makefs.c
115–120 ↗(On Diff #17560)

Why move the check away from gettimeofday()?

250 ↗(On Diff #17560)

Indentation level looks wrong in phabricator.

380–381 ↗(On Diff #17560)

Note st_ino will likely not be 1 in this case. Is that intentional?

383–389 ↗(On Diff #17560)

gratuitous block/braces

Many of the slightly odd looking code or style(9) issues are a result of my desire to reduce diffs with NetBSD; although we did not import it as vendor code and NetBSD isn't per se upstream I want to follow what they've done unless there's a strong reason to do otherwise.

usr.sbin/makefs/cd9660.c
622 ↗(On Diff #17560)

This is indeed not style(9) compliant, but is how it is in NetBSD. Although we didn't import makefs as vendor code I would like to keep the diffs as small as possible.

1264–1265 ↗(On Diff #17560)

Check this vs cd9660_time_915 in cd9660_finalize_PVD

usr.sbin/makefs/ffs.c
546 ↗(On Diff #17560)

Indeed. This is from upstream, but it does seem strange. It should be != 0 I think.

pfg added a reviewer: pfg.

The handling of srandom() looks good.

This revision is now accepted and ready to land.Jun 13 2016, 10:45 PM

Looks ok, modulo some issues cem brought up...

usr.sbin/makefs/makefs.c
115–120 ↗(On Diff #17560)

+1. I'm guessing this has to do with something upstream did?

250 ↗(On Diff #17560)

Agreed.

Many of the slightly odd looking code or style(9) issues are a result of my desire to reduce diffs with NetBSD; although we did not import it as vendor code and NetBSD isn't per se upstream I want to follow what they've done unless there's a strong reason to do otherwise.

usr.sbin/makefs/ffs.c
546 ↗(On Diff #17560)

also note walk.c gets it right -- if (stampst.st_ino) {
will commit w/ != 0

usr.sbin/makefs/makefs.c
115–120 ↗(On Diff #17560)

Yes, there are additional #ifdefs upstream. I expect to continue migrating to be closer to NetBSD over time so plan to leave these sorts of things as they are, even if they seem a bit unusual for now.

250 ↗(On Diff #17560)

Yes break ended up indented one too many levels, thanks.

This revision was automatically updated to reflect the committed changes.