Hi,

On Fri, Sep 19, 2014 at 06:30:09PM -0700, enh wrote:
> how do i regenerate an xlat .in file from a uapi header file? i notice
> that fsmagic.in is very out of date.

fsmagic.in differs from most of other xlat files: it doesn't rely on
macros provided by linux kernel headers because there was no
<linux/magic.h> before linux 2.6.19.  We can either continue or end this
practice.

In the former case, the script to regenerate fsmagic.in is likely to be this:
$ sed -rn 
's/^#define[[:space:]]+([^[:space:]]+)[[:space:]]+(0x[^[:space:]]+).*/\t{\2,\t"\1"\t},/p'
 include/uapi/linux/magic.h |sort -u -k2,2

In the latter case, a bit shorter script would do:
$ sed -rn 
's/^#define[[:space:]]+([^[:space:]]+)[[:space:]]+(0x[^[:space:]]+).*/\2\t\1/p' 
include/uapi/linux/magic.h |sort -u -k1,1 |cut -f2
(preceded by #include <linux/magic.h>)

The "sort -u -k" is required to get rid of EXT2/3/4 duplications.

I'm slightly more inclined to choose a conservative approach.


-- 
ldv

Attachment: pgp9ScZbNyniz.pgp
Description: PGP signature

------------------------------------------------------------------------------
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to