#!/bin/bash LACK_HEADERS="asm-compat.h atomic.h auxvec.h \ bitops.h bug.h byteorder.h \ cache.h cputable.h cputime.h current.h div64.h \ elf.h errno.h \ fcntl.h \ hardirq.h hw_irq.h \ ioctl.h ioctls.h ipcbuf.h irq.h \ linkage.h local.h \ mman.h module.h \ param.h percpu.h poll.h posix_types.h processor.h ptrace.h \ reg.h resource.h rwsem.h \ seccomp.h semaphore.h sembuf.h siginfo.h signal.h socket.h sockios.h stat.h string.h synch.h \ termios.h termbits.h thread_info.h timex.h topology.h types.h \ uaccess.h unistd.h" KERNEL_DIR="/usr/src/linux" case $1 in fix|unfix|check) echo "Into the Linux Kernel source directry a.k.a ${KERNEL_DIR}." ; echo "Go to include/asm-ppc..." ; cd ${KERNEL_DIR}/include/asm-ppc ; for HEADER in ${LACK_HEADERS} ; do if [[ $1 == "fix" || $1 == "check" ]] then echo "Symlink: `ls -l ../asm-powerpc/${HEADER}`." ; if [[ $1 == "fix" ]] then ln -s ../asm-powerpc/${HEADER} ${HEADER} ; fi ; fi ; if [[ $1 == "unfix" || $1 == "check" ]] then echo "Unsymlink: `ls -l ${HEADER}`." ; if [[ $1 == "unfix" ]] then rm ${HEADER} ; fi ; fi ; done ; # Stupid unionfs header file in out of kernel directory. :/ #ln -s /usr/include/asm/segment.h segment.h ; ;; *) echo "Usage: lack_headers.sh [fix|unfix|check]" ; ;; esac ;