1 #!/bin/bash 2 3 if [ -z "$1" -o -z "$2" ]; then 4 echo "Usage: $0 kernel-file e2fsprogs-file" 5 exit 0 6 fi 7 8 # Transform a few things to fit the compatibility things defined in jfs_user.h. 9 # Use the ext2fs_ endian conversion functions because they truncate oversized 10 # inputs (e.g. passing a u32 to cpu_to_be16()) like the kernel versions and 11 # unlike the libc6 versions. 12 exec sed -e 's/JBD_/JFS_/g' \ 13 -e 's/JBD2_/JFS_/g' \ 14 -e 's/jbd2_journal_/journal_/g' \ 15 -e 's/__be/__u/g' \ 16 -e 's/struct kmem_cache/lkmem_cache_t/g' \ 17 -e 's/cpu_to_be/ext2fs_cpu_to_be/g' \ 18 -e 's/be\([0-9][0-9]\)_to_cpu/ext2fs_be\1_to_cpu/g' \ 19 < "$1" > "$2" 20