> > sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* > > \3 */:; s:->::; p;}" < asm-offsets.s [] > > Can you come up with a _minimal_ fix that makes it compatible with > > busy-box AND GNU sed? > > Script works in GNU and busybox sed, except that "$#" thing. > Let's wait for `set -x` feedback. Unreadable for humans `sed` can be as short as this: [busybox] sed '/#def/s-.[$#]- -gp;d' or without "-fverbose-asm" (i.e. #comments after instruction) even like this olecom@flower:/tmp/blinux$ busybox sed '/#def/s [$] p;d' arch/x86/kernel/asm-offsets.s + busybox sed '/#def/s [$] p;d' arch/x86/kernel/asm-offsets.s #define tsk_state 0 /*offsetof(struct task_struct, state)*/ #define tsk_flags 20 /*offsetof(struct task_struct, flags)*/ #define tsk_pid 328 /*offsetof(struct task_struct, pid)*/ olecom@flower:/tmp/blinux$ The only thing to change is (unreadable) #define in asm-offsets.c: #define DEFINE(sym, val) \ asm volatile("\n#define " #sym " %0 /*" #val "*/": : "i" (val)) (BLANK also, but it's a phony load) _____ -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html