comparison sources/more/migrate-kernel.sh @ 1123:075c7e067ccd

Scripts generally say thing-thing not thing_thing, so rename migrate_kernel.
author Rob Landley <rob@landley.net>
date Fri, 18 Jun 2010 15:48:14 -0500
parents sources/more/migrate_kernel.sh@61aa2ac67660
children f44ca6ebdab7
comparison
equal deleted inserted replaced
1122:481386888ace 1123:075c7e067ccd
1 #!/bin/bash
2
3 # Calculate new config for UNSTABLE kernel based on stable kernel config.
4 # I.E. calculate miniconfig-alt-linux based on miniconfig-linux for a target.
5
6 # Expand miniconfig with the old kernel, copy .config to new kernel, run
7 # make oldconfig, compress to miniconfig, copy to sources/targets/$TARGET
8
9 . sources/include.sh
10
11 read_arch_dir "$1"
12
13 blank_tempdir "$WORK"
14
15 [ -z "$BOOT_KARCH" ] && BOOT_KARCH="$KARCH"
16
17 # Expand config against current kernel
18
19 USE_UNSTABLE=
20
21 setupfor linux
22
23 cp "$(getconfig linux)" mini.conf || dienow
24 [ "$SYSIMAGE_TYPE" == "initramfs" ] &&
25 (echo "CONFIG_BLK_DEV_INITRD=y" >> mini.conf || dienow)
26 make ARCH="$BOOT_KARCH" KCONFIG_ALLCONFIG=mini.conf $LINUX_FLAGS \
27 allnoconfig > /dev/null &&
28 cp .config "$WORK"
29
30 cleanup
31
32 USE_UNSTABLE=linux
33
34 setupfor linux
35
36 cp "$WORK/.config" . &&
37 yes "" | make ARCH="$BOOT_KARCH" oldconfig &&
38 mv .config walrus &&
39 ARCH="${BOOT_KARCH}" "$SOURCES/toys/miniconfig.sh" walrus || dienow
40
41 CFG="$CONFIG_DIR/$ARCH_NAME/miniconfig-alt-linux"
42 if [ -e "$CFG" ] && ! cmp mini.config "$CFG"
43 then
44 mv "$CFG" "${CFG}.bak" || dienow
45 fi
46 mv mini.config "$CFG"
47
48 cleanup