annotate linux-kernel.sh @ 1529:90da269bc09c

Minor cleanup and remove hardlinking for chroot-splice: it's slower and uses more disk space but doesn't damage external copy if something goes wrong.
author Rob Landley <rob@landley.net>
date Sun, 10 Jun 2012 20:34:04 -0500
parents f19ce5e2ec02
children 3873d1b178e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1350
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
2
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 # Package a root filesystem directory into a filesystem image file
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
4
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 source sources/include.sh || exit 1
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
6
1398
b74d36876c0a Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents: 1358
diff changeset
7 # Parse sources/targets/$1
1350
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
8
1398
b74d36876c0a Replace read_arch_dir with load_target, which understands that sources/targets/$TARGET can be a file or a directory.
Rob Landley <rob@landley.net>
parents: 1358
diff changeset
9 load_target "$1"
1350
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
10
1516
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
11 setupfor linux
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
12
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
13 # Get miniconfig. If we have an initramfs, incorporate it into the kernel image.
1350
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
14
1516
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
15 getconfig linux > mini.conf
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
16 CPIO="$BUILD/root-image-$ARCH/initramfs_data.cpio"
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
17 [ -e "$CPIO" ] &&
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
18 echo -e "CONFIG_BLK_DEV_INITRD=y\nCONFIG_INITRAMFS_SOURCE=\"$CPIO\"\nCONFIG_INITRAMFS_COMPRESSION_GZIP=y" >> mini.conf
1350
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
19
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 # Build linux kernel for the target
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
21
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
22 [ -z "$BOOT_KARCH" ] && BOOT_KARCH=$KARCH
1516
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
23 make ARCH=$BOOT_KARCH $LINUX_FLAGS KCONFIG_ALLCONFIG=mini.conf allnoconfig \
f19ce5e2ec02 Combining KCONFIG_ALLSYMS=<() sometimes works, but not always. Just use a file.
Rob Landley <rob@landley.net>
parents: 1406
diff changeset
24 >/dev/null &&
1350
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 make -j $CPUS ARCH=$BOOT_KARCH $DO_CROSS $LINUX_FLAGS $VERBOSITY &&
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 cp "$KERNEL_PATH" "$STAGE_DIR"
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
27
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 cleanup
7eabfa815c90 Split up system-image.sh into root-image.sh, linux-kernel.sh, and system-image.sh. Rename CROSS_HOST_ARCH to CROSS_COMPILER_HOST.
Rob Landley <rob@landley.net>
parents:
diff changeset
29
1406
aca2150c9531 Fix variant target bug where linux-kernel.sh was using the base architecture name to create the stage tarball. It was both wrong and didn't work when we hadn't built the base architecture yet.
Rob Landley <rob@landley.net>
parents: 1398
diff changeset
30 ARCH="$ARCH_NAME" create_stage_tarball