#!/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 source sources/include.sh load_target $1 rmdir $STAGE_DIR test -z $BOOT_KARCH && global BOOT_KARCH := $KARCH # Expand config against current kernel global 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 global USE_ALT := 'linux' setupfor linux mv "$WORK/.config" . && yes "" | make ARCH="$BOOT_KARCH" oldconfig && mv .config walrus && env ARCH=$(BOOT_KARCH) "$SOURCES/toys/miniconfig.sh" walrus || dienow global CFG := ""$CONFIG_DIR/$ARCH_NAME/miniconfig-alt-linux"" if test -e $CFG && ! cmp mini.config $CFG { mv $CFG "$(CFG).bak" || dienow } mv mini.config $CFG cleanup diff -u $[sort "$WORK/miniconfig-linux] $[sort $CFG] \ | sed '/^ /d;/^@/d;1,2d' | tee "$WORK/mini.diff" (CommandList children: [ (C {(.)} {(sources/include.sh)}) (C {(load_target)} {(DQ ($ VSub_Number "$1"))}) (C {(rmdir)} {(DQ ($ VSub_Name "$STAGE_DIR"))}) (AndOr children: [ (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$BOOT_KARCH"))} {(Lit_Other "]")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:BOOT_KARCH) op: Equal rhs: {(DQ ($ VSub_Name "$KARCH"))} spids: [48] ) ] spids: [48] ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:USE_ALT) op:Equal rhs:{(SQ )} spids:[58])] spids: [58] ) (SimpleCommand words: [{(getconfig)} {(linux)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$WORK") (/miniconfig-linux))} spids: [65] ) ] ) (C {(setupfor)} {(linux)}) (AndOr children: [ (SimpleCommand words: [ {(make)} {(Lit_VarLike "ARCH=") ($ VSub_Name "$BOOT_KARCH")} {($ VSub_Name "$LINUX_FLAGS")} {(Lit_VarLike "KCONFIG_ALLCONFIG=") (DQ ($ VSub_Name "$WORK") (/miniconfig-linux))} {(allnoconfig)} ] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[95])] ) (C {(cp)} {(.config)} {(DQ ($ VSub_Name "$WORK"))}) ] op_id: Op_DAmp ) (C {(cleanup)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:USE_ALT) op:Equal rhs:{(linux)} spids:[112])] spids: [112] ) (C {(setupfor)} {(linux)}) (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$WORK") (/.config))} {(.)}) (AndOr children: [ (Pipeline children: [ (C {(yes)} {(DQ )}) (C {(make)} {(Lit_VarLike "ARCH=") (DQ ($ VSub_Name "$BOOT_KARCH"))} {(oldconfig)}) ] negated: False ) (AndOr children: [ (C {(mv)} {(.config)} {(walrus)}) (AndOr children: [ (SimpleCommand words: [{(DQ ($ VSub_Name "$SOURCES") (/toys/miniconfig.sh))} {(walrus)}] more_env: [ (env_pair name: ARCH val: {(DQ (${ VSub_Name BOOT_KARCH))} spids: [158] ) ] ) (C {(dienow)}) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CFG) op: Equal rhs: {(DQ ($ VSub_Name "$CONFIG_DIR") (/) ($ VSub_Name "$ARCH_NAME") (/miniconfig-alt-linux))} spids: [177] ) ] spids: [177] ) (If arms: [ (if_arm cond: [ (AndOr children: [ (C {(Lit_Other "[")} {(-e)} {(DQ ($ VSub_Name "$CFG"))} {(Lit_Other "]")}) (Pipeline children: [(C {(cmp)} {(mini.config)} {(DQ ($ VSub_Name "$CFG"))})] negated: True ) ] op_id: Op_DAmp ) ] action: [ (AndOr children: [ (C {(mv)} {(DQ ($ VSub_Name "$CFG"))} {(DQ (${ VSub_Name CFG) (.bak))}) (C {(dienow)}) ] op_id: Op_DPipe ) ] spids: [-1 209] ) ] spids: [-1 229] ) (C {(mv)} {(mini.config)} {(DQ ($ VSub_Name "$CFG"))}) (C {(cleanup)}) (Pipeline children: [ (C {(diff)} {(-u)} { (CommandSubPart command_list: (CommandList children: [(C {(sort)} {(DQ ($ VSub_Name "$WORK") (/miniconfig-linux))})] ) left_token: spids: [247 254] ) } { (CommandSubPart command_list: (CommandList children:[(C {(sort)} {(DQ ($ VSub_Name "$CFG"))})]) left_token: spids: [256 262] ) } ) (C {(sed)} {(SQ <"/^ /d;/^@/d;1,2d">)}) (C {(tee)} {(DQ ($ VSub_Name "$WORK") (/mini.diff))}) ] negated: False ) ] )