xlat.in

enh enh at google.com
Mon Sep 22 17:09:39 UTC 2014


On Sat, Sep 20, 2014 at 4:52 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> 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.

i just did a "git fetch" before doing this and found you'd already
done it (and more). thanks! merged to Android.

 --elliott




More information about the Strace-devel mailing list