annotate sources/sections/linux-headers.sh @ 1065:1d776e44b908

Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
author Rob Landley <rob@landley.net>
date Wed, 05 May 2010 22:27:14 -0500
parents a34a4954c640
children 2f39d1bfb2fd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
906
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 # Install Linux kernel headers.
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 setupfor linux
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
964
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
5 # This isn't strictly necessary, but if we have a kernel config, expand
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
6 # and copy it.
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
7
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
8 cp "$(getconfig linux)" mini.conf &&
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
9 if [ "$SYSIMAGE_TYPE" == "initramfs" ]
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
10 then
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
11 echo "CONFIG_BLK_DEV_INITRD=y" >> mini.conf
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
12 fi
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
13 [ -e mini.conf ] &&
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
14 make ARCH=${BOOT_KARCH:-$KARCH} KCONFIG_ALLCONFIG=mini.conf $LINUX_FLAGS \
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
15 allnoconfig >/dev/null &&
1065
1d776e44b908 Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
Rob Landley <rob@landley.net>
parents: 1039
diff changeset
16 mkdir -p "$STAGE_DIR/src" &&
1d776e44b908 Save the uClibc and linux .config files in the native toolchain, and install them with the rest of the native toolchain. Don't bother extracting and configuring the kernel if we don't need to.
Rob Landley <rob@landley.net>
parents: 1039
diff changeset
17 cp .config "$STAGE_DIR/src/config-linux"
964
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
18
edf9264f2d26 Make root filesystem's usr/src has config-linux and config-uClibc as well as config-busybox.
Rob Landley <rob@landley.net>
parents: 906
diff changeset
19
906
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 # Install Linux kernel headers (for use by uClibc).
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 make -j $CPUS headers_install ARCH="${KARCH}" INSTALL_HDR_PATH="$STAGE_DIR" &&
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
22 # This makes some very old package builds happy.
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 ln -s ../sys/user.h "$STAGE_DIR/include/asm/page.h"
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
24
5e0cbc73da55 Split out linux-headers, uClibc, and uClibc++ as their own sections.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 cleanup
1039
a34a4954c640 Cleanup debris files installed by the kernel's headers install, spotted by Denys Vlasenko.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
26
a34a4954c640 Cleanup debris files installed by the kernel's headers install, spotted by Denys Vlasenko.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
27 # Remove debris the kernel puts in there for no apparent reason.
a34a4954c640 Cleanup debris files installed by the kernel's headers install, spotted by Denys Vlasenko.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
28
a34a4954c640 Cleanup debris files installed by the kernel's headers install, spotted by Denys Vlasenko.
Rob Landley <rob@landley.net>
parents: 964
diff changeset
29 find "$STAGE_DIR/include" -name ".install" -print0 -or -name "..install.cmd" -print0 | xargs -0 rm