view more/migrate-kernel.sh @ 1786:0787ceb820bf draft 1.4.2

When x86-64 switched on NPTL in uClibc, distcc broke, and it turns out fully native compiles under qemu never worked due to qemu not quite emulating floating point right and confusing the perl build with zero not comparing equal to zero. As long as it's broken anyway, switch it over to musl and fix it up on that side. It's no longer worth trying to fix anything broken in uClibc, the project is dead. (I'm aware of uClibc-ng, and am treating it exactly the same way I treated the ecommstation reboot of OS/2.)
author Rob Landley <rob@landley.net>
date Fri, 11 Sep 2015 13:25:14 -0500
parents ad5303b6d35a
children
line wrap: on
line source

#!/bin/bash

# Calculate new config for ALT kernel based on stable kernel config.
# I.E. calculate miniconfig-alt-linux based on miniconfig-linux for a target.

# Expand miniconfig with the old kernel, copy .config to new kernel, run
# make oldconfig, compress to miniconfig, copy to sources/targets/$TARGET

. sources/include.sh

load_target "$1"
rmdir "$STAGE_DIR"

[ -z "$BOOT_KARCH" ] && BOOT_KARCH="$KARCH"

# Expand config against current kernel

USE_ALT=

getconfig linux > "$WORK/miniconfig-linux"

setupfor linux

make ARCH=$BOOT_KARCH $LINUX_FLAGS KCONFIG_ALLCONFIG="$WORK/miniconfig-linux" \
  allnoconfig >/dev/null &&
cp .config "$WORK"

cleanup

USE_ALT=linux

setupfor linux

mv "$WORK/.config" . &&
yes "" | make ARCH="$BOOT_KARCH" oldconfig &&
mv .config walrus &&
ARCH="${BOOT_KARCH}" "$SOURCES/toys/miniconfig.sh" walrus || dienow

CFG="$CONFIG_DIR/$ARCH_NAME/miniconfig-alt-linux"
if [ -e "$CFG" ] && ! cmp mini.config "$CFG"
then
  mv "$CFG" "${CFG}.bak" || dienow
fi
mv mini.config "$CFG"

cleanup

diff -u <(sort "$WORK/miniconfig-linux") <(sort "$CFG") \
 | sed '/^ /d;/^@/d;1,2d' | tee "$WORK/mini.diff"