summaryrefslogtreecommitdiffstats
path: root/installkernel
blob: 2456c654e5f1fb89d279b7ef912a00810a586d62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
set -x
ARCH="x86"
kernver="[email protected]"
echo "Enter the kernel name"
read kernelname
#Copy the bzImage etc.

cp -v  System.map /boot/System.map26${kernelname}
cp -v arch/$ARCH/boot/bzImage /boot/vmlinuz26${kernelname}
install -m644 -D vmlinux /usr/src/linux-${kernver}/vmlinux
pkgname="kernel26-$kernelname"

echo "Generating mkinitcpio stuff"
/bin/echo "ALL_kver=$kernver" > /etc/mkinitcpio.d/kernel26${kernelname}.kver

/bin/echo "
# mkinitcpio preset file for $kernelname 

########################################/
# DO NOT EDIT THIS LINE:
source /etc/mkinitcpio.d/kernel26${kernelname}.kver
########################################
ALL_config=\"/etc/mkinitcpio.conf\"

PRESETS=('default' 'fallback')

default_image=\"/boot/kernel26-${kernelname}.img\"

fallback_image=\"/boot/kernel26-fallback${kernelname}.img\" 
fallback_options=\"-S autodetect\" 
" > /etc/mkinitcpio.d/kernel26${kernelname}.preset

echo "Verify mkinitcpio.conf and others"
read
 
 
echo "Installing modules to /lib/modules/$kernver"
read
sudo make modules_install

echo "Time for headers..hmmm"
read
 
  pushd /lib/modules/${kernver}
  ln -sf /usr/src/linux-${kernver} build
  popd
  install -D -m644 Makefile \
    /usr/src/linux-${kernver}/Makefile
  install -D -m644 kernel/Makefile \
    /usr/src/linux-${kernver}/kernel/Makefile
  install -D -m644 .config \
    /usr/src/linux-${kernver}/.config
  mkdir -p /usr/src/linux-${kernver}/include

  for i in acpi asm-generic config generated linux math-emu media net pcmcia scsi sound trace video; do
    cp -a include/$i /usr/src/linux-${kernver}/include/
  done
 
  # copy arch includes for external modules
  mkdir -p /usr/src/linux-${kernver}/arch/x86
  cp -a arch/x86/include /usr/src/linux-${kernver}/arch/x86/
 
  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers /usr/src/linux-${kernver}
  cp -a scripts /usr/src/linux-${kernver}
  # fix permissions on scripts dir
  chmod og-w -R /usr/src/linux-${kernver}/scripts
  mkdir -p /usr/src/linux-${kernver}/.tmp_versions
 
  mkdir -p /usr/src/linux-${kernver}/arch/$ARCH/kernel
 
  cp arch/$ARCH/Makefile /usr/src/linux-${kernver}/arch/$ARCH/
  cp arch/$ARCH/kernel/asm-offsets.s /usr/src/linux-${kernver}/arch/$ARCH/kernel/
 
  # add headers for lirc package
  #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video
  #cp drivers/media/video/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/
  #for i in bt8xx cpia2 cx25840 cx88 em28xx et61x251 pwc saa7134 sn9c102 usbvideo zc0301; do
  # mkdir -p /usr/src/linux-${kernver}/drivers/media/video/$i
  # cp -a drivers/media/video/$i/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/video/$i
  #done
  # add docbook makefile
  install -D -m644 Documentation/DocBook/Makefile \
    /usr/src/linux-${kernver}/Documentation/DocBook/Makefile
  # add dm headers
  #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  #cp drivers/md/*.h  ${pkgdir}/usr/src/linux-${_kernver}/drivers/md
  # add inotify.h
  mkdir -p /usr/src/linux-${kernver}/include/linux
  cp include/linux/inotify.h /usr/src/linux-${kernver}/include/linux/
  # add wireless headers
  #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  #cp net/mac80211/*.h ${pkgdir}/usr/src/linux-${_kernver}/net/mac80211/
  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/9912
  #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core
  #cp drivers/media/dvb/dvb-core/*.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/dvb-core/
  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/11194
  #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  #cp include/config/dvb/*.h ${pkgdir}/usr/src/linux-${_kernver}/include/config/dvb/
  # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  # in reference to:
  # http://bugs.archlinux.org/task/13146
  #mkdir -p ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  #cp drivers/media/dvb/frontends/lgdt330x.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  #cp drivers/media/video/msp3400-driver.h ${pkgdir}/usr/src/linux-${_kernver}/drivers/media/dvb/frontends/
  # add xfs and shmem for aufs building
  mkdir -p /usr/src/linux-${kernver}/fs/xfs
  mkdir -p /usr/src/linux-${kernver}/mm
  cp fs/xfs/xfs_sb.h /usr/src/linux-${kernver}/fs/xfs/xfs_sb.h
  # add headers vor virtualbox
  # in reference to:
  # http://bugs.archlinux.org/task/14568
  cp -a include/drm /usr/src/linux-${kernver}/include/
  # add headers for broadcom wl
  # in reference to:
  # http://bugs.archlinux.org/task/14568
  cp -a include/trace /usr/src/linux-${kernver}/include/
  # copy in Kconfig files
  for i in `find . -name "Kconfig*"`; do
    mkdir -p /usr/src/linux-${kernver}/`echo $i | sed 's|/Kconfig.*||'`
    cp $i /usr/src/linux-${kernver}/$i
  done

  chown -R root.root /usr/src/linux-${kernver}
  find /usr/src/linux-${kernver} -type d -exec chmod 755 {} \;
  # remove unneeded architectures
  #rm -rf /usr/src/linux-${kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}

echo "Installing the initramfs image"
mkinitcpio -p kernel26${kernelname}

depmod $kernver
set +x

echo "Rebuild packages here: /home/raghavendra/Arch/Build/out-of-kernel"