(command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<.>} {<./build.conf>}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] ) (C {<export>} {<Id.Lit_VarLike 'LANG='> <C>}) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:DEBUG) op:assign_op.Equal rhs:{<0>} spids:[29])] ) (C {<rm>} {<-f>} {<./fw-> <Id.Lit_Star '*'> <.log>}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$DEBUG')} {<-ne>} {<1>} {<-a>} {<-d>} {<zfirmware_workdir>} {<Id.Lit_RBracket ']'>} ) (C {<rm>} {<-r>} {<zfirmware_workdir>}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CWD) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children:[(C {<pwd>})]) ) } spids: [68] ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (command.Pipeline children: [(C {<busybox>}) (C {<grep>} {<-qow>} {(SQ <stat>)})] negated: F ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:STAT) op: assign_op.Equal rhs: {(SQ <'busybox stat'>)} spids: [91] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:STAT) op: assign_op.Equal rhs: {<stat>} spids: [98] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SRC_FW_DIR) op: assign_op.Equal rhs: {(SQ <../linux-firmware>)} spids: [106] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DEST_FW_DIR) op: assign_op.Equal rhs: {(SQ <zfirmware_workdir/lib>)} spids: [111] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SRC_FILE_FW) op: assign_op.Equal rhs: {(${ Id.VSub_Name SRC_FW_DIR) </WHENCE>} spids: [117] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dotconfig) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<find>} {<output>} {<-maxdepth>} {<1>} {<-type>} {<f>} {<-name>} {(SQ <'DOTconfig*'>)} ) (C {<head>} {<-1>}) ] negated: F ) ] ) ) } spids: [123] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-f>} {(DQ ($ Id.VSub_DollarName '$dotconfig'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DOTCONFIG_str) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<grep>} {<-v>} {<-E>} {(SQ <'^#|is not set$'>)} {($ Id.VSub_DollarName '$dotconfig')} ) ] ) ) } spids: [169] ) ] ) ] spids: [152 166] ) ] else_action: [ (C {<echo>} {(DQ <'WARNING: No DOTconfig file in output/'>)}) (C {<echo>} {(DQ <'Put a DOTconfig file there...'>)}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FIRMWARE_SFS) op: assign_op.Equal rhs: { (DQ <sources/fdrv_> (${ Id.VSub_Name kernel_version) <_> (${ Id.VSub_Name package_name_suffix) <.sfs> ) } spids: [207] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FIRMWARE_RESULT_DIR) op: assign_op.Equal rhs: {(SQ <zfirmware_workdir/lib/firmware>)} spids: [220] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FIRMWARE_EXTRA_DIR) op: assign_op.Equal rhs: {(SQ <zfirmware_workdir/lib/linux-firmware>)} spids: [225] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:kernel_package) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<find>} {<output>} {<-type>} {<d>} {<-name>} {(SQ <'linux_kernel*'>)}) (C {<head>} {<-1>}) ] negated: F ) ] ) ) } spids: [231] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {(DQ (${ Id.VSub_Name kernel_package))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:kernel_package) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<find>} {($ Id.VSub_DollarName '$CWD')} {<-type>} {<d>} {<-name>} {(SQ <'linux_kernel*'>)} ) (C {<head>} {<-1>}) ] negated: F ) ] ) ) } spids: [278] ) ] ) ] spids: [257 275] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:dest_kernel_package) op: assign_op.Equal rhs: {(${ Id.VSub_Name kernel_package) </lib/firmware>} spids: [319] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {(${ Id.VSub_Name dest_kernel_package)} {<Id.Lit_RBracket ']'>} ) (C {<mkdir>} {<-p>} {($ Id.VSub_DollarName '$dest_kernel_package')}) ] ) (command.ShFunction name: func_git body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ ($ Id.VSub_DollarName '$SRC_FW_DIR'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<cd>} {($ Id.VSub_DollarName '$SRC_FW_DIR')}) (C {<echo>} {(DQ <'Updating the git firmware repo'>)}) (C {<git>} {<pull>}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>} ) (C {<echo>} {(DQ <'Failed to update git firmware'>)}) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<0>} ) ] spids: [368 380] ) ] else_action: [ (C {<cd>} {<..>}) (C {<echo>} {(DQ <'Cloning the firmware repo may take a long time'>)}) (C {<git>} {<clone>} {<git> <Id.Lit_Other ':'> <//git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git> } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<echo>} {(DQ <'Failed to clone the git firmware repo'>)}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] spids: [454 466] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<0>} ) ] ) ] ) ) (command.ShFunction name: process_driver body: (command.BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'driver='> ($ Id.VSub_Number '$1')}) (C {<local>} {<Id.Lit_VarLike 'DRIVER='> (braced_var_sub token: <Id.VSub_Name driver> suffix_op: (suffix_op.Unary op_id:Id.VOp1_DCaret arg_word:{}) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name DRIVER> suffix_op: (suffix_op.PatSub pat: {<->} replace: {<_>} replace_mode: Id.Lit_Slash ) ) } spids: [516] ) ] ) (command.Case to_match: {($ Id.VSub_DollarName '$DRIVER')} arms: [ (case_arm pat_list: [{<RADEON>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {(SQ <'DRM_RADEON='>)} spids: [540] ) ] ) ] spids: [537 538 545 -1] ) (case_arm pat_list: [{<NOUVEAU>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {(SQ <'DRM_NOUVEAU='>)} spids: [551] ) ] ) ] spids: [548 549 556 -1] ) (case_arm pat_list: [{<AMDGPU>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {(SQ <'DRM_AMDGPU='>)} spids: [562] ) ] ) ] spids: [559 560 567 -1] ) (case_arm pat_list: [{<I915>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {(SQ <'DRM_I915='>)} spids: [573] ) ] ) ] spids: [570 571 578 -1] ) (case_arm pat_list: [{<KEYSPAN>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {(SQ <'SERIAL_KEYSPAN='>)} spids: [584] ) ] ) ] spids: [581 582 588 -1] ) (case_arm pat_list: [{<LIBERTAS>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {<LIBERTAS_USB>} spids: [594] ) ] ) ] spids: [591 592 597 -1] ) (case_arm pat_list: [{<RTL8821AE>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {<8821AE>} spids: [602] ) ] ) ] spids: [600 601 605 -1] ) (case_arm pat_list: [{<MWIFIEX>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {<MWIFIEX_USB>} spids: [611] ) ] ) ] spids: [608 609 614 -1] ) (case_arm pat_list: [{<MWLWIFI>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DRIVER) op: assign_op.Equal rhs: {(SQ <CONFIG_MAC80211>)} spids: [620] ) ] ) ] spids: [617 618 624 -1] ) ] ) (C {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$driver') <' '>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:D) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$DOTCONFIG_str'))}) (C {<grep>} {($ Id.VSub_DollarName '$DRIVER')}) (C {<head>} {<-n1>}) ] negated: F ) ] ) ) } spids: [643] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$D'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<echo>}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] spids: [667 681] ) ] else_action: [ (C {<echo>} {<-->} {($ Id.VSub_DollarName '$D')} {<-->}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<0>} ) ] ) ] ) ) (command.ShFunction name: get_func body: (command.BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'file='> (${ Id.VSub_Number 1)}) (C {<local>} {<Id.Lit_VarLike 'source_path='> (${ Id.VSub_Name SRC_FW_DIR) </> (${ Id.VSub_Name file)} ) (C {<local>} {<Id.Lit_VarLike 'target_dir='> (${ Id.VSub_Name CWD) </> (${ Id.VSub_Name FIRMWARE_EXTRA_DIR) </> (${ Id.VSub_Name file) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:target_dir) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name target_dir> suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: {<Id.Lit_Slash /> <'*'>} ) ) } spids: [757] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {(DQ (${ Id.VSub_Name target_dir))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [(C {<mkdir>} {<-p>} {(${ Id.VSub_Name target_dir)})] spids: [769 787] ) ] ) (command.Simple words: [{<cp>} {<-d>} {(${ Id.VSub_Name source_path)} {(${ Id.VSub_Name target_dir)}] redirects: [(redir.Redir op:<Id.Redir_Great '2>'> fd:2 arg_word:{</dev/null>})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [ {<echo>} { (DQ ($ Id.VSub_DollarName '$file') <' \t'> (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (C {($ Id.VSub_DollarName '$STAT')} {<-c>} {<Id.Lit_Other '%'> <s>} {($ Id.VSub_DollarName '$SRC_FW_DIR') </> ($ Id.VSub_DollarName '$file') } ) ] ) ) ) } ] redirects: [(redir.Redir op:<Id.Redir_DGreat '>>'> fd:-1 arg_word:{<fw-1.log>})] ) ] spids: [821 833] ) ] else_action: [ (command.Simple words: [{<echo>} {(DQ <'FAILURE: '> ($ Id.VSub_DollarName '$file'))}] redirects: [(redir.Redir op:<Id.Redir_DGreat '>>'> fd:-1 arg_word:{<fw-1.log>})] ) ] ) ] ) ) (command.ShFunction name: extract_firmware body: (command.BraceGroup children: [ (command.Subshell command_list: (command.CommandList children: [ (command.WhileUntil keyword: <Id.KW_While while> cond: [ (command.Sentence child: (C {<read>} {<-r>} {<field>} {<value>} {<etc>}) terminator: <Id.Op_Semi _> ) ] body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$field')} arms: [ (case_arm pat_list: [{(DQ <'Driver:'>)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:driver) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$value')} spids: [921] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<process_driver>} {($ Id.VSub_DollarName '$driver')}) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] ) (command.Simple words: [ {<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$driver') <' '>)} ] redirects: [ (redir.Redir op: <Id.Redir_GreatAnd '>&'> fd: -1 arg_word: {<2>} ) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<1>} {<Id.Lit_RBracket ']'>}) terminator: <Id.Op_Semi _> ) ] body: (command.DoGroup children: [ (C {<read>} {<-r>} {<field>} {<value>} {<etc>}) (command.Case to_match: {($ Id.VSub_DollarName '$field')} arms: [ (case_arm pat_list: [{(DQ <'File:'>)}] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$value')} spids: [987] ) ] ) terminator: <Id.Op_Semi _> ) (C {<get_func>} {($ Id.VSub_DollarName '$file')}) ] spids: [982 985 996 -1] ) (case_arm pat_list: [{(DQ <'License:'>)} {(DQ <'Licence:'>)}] action: [ (command.ControlFlow token: <Id.ControlFlow_Break break> ) ] spids: [999 1006 1010 -1] ) ] ) ] ) ) ] spids: [915 918 -1 1019] ) ] ) ] ) redirects: [ (redir.Redir op: <Id.Redir_Less '<'> fd: -1 arg_word: {(${ Id.VSub_Name SRC_FILE_FW)} ) ] ) ] ) redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<fw-2.log>})] ) ] ) ) (command.ShFunction name: fw_filter body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:list) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1046] ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_Number '$2'))} {<Id.Lit_RBracket ']'>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:B) op: assign_op.Equal rhs: {<10000000>} spids: [1062] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:B) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [1067] ) ] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$B')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:B) op: assign_op.Equal rhs: {<10000000>} spids: [1086] ) ] ) ] ) (C {<echo>} {(DQ <'Filtering with '> ($ Id.VSub_DollarName '$list'))}) (command.Subshell command_list: (command.CommandList children: [ (command.Sentence child: (C {<echo>}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (C {<echo>}) terminator: <Id.Op_Semi _> ) (C {<echo>} {(DQ <'Filtering with '> ($ Id.VSub_DollarName '$list'))}) (C {<echo>} {(SQ <'FILTERED FIRMWARE LIST IN ZDRV'>)}) (C {<echo>} {(SQ <'=============================='>)}) (C {<mkdir>} {<-p>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filelist) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<find>} {(${ Id.VSub_Name FIRMWARE_EXTRA_DIR)}) (C {<sed>} { (DQ <'s%'> (${ Id.VSub_Name FIRMWARE_EXTRA_DIR) <Id.Lit_Other '\\'> <'/%%'> ) } ) ] negated: F ) ] ) ) } spids: [1140] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:filelist2) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<find>} {(${ Id.VSub_Name SRC_FW_DIR)}) (C {<sed>} {<-e>} { (DQ <'s%'> (${ Id.VSub_Name SRC_FW_DIR) <Id.Lit_Other '\\'> <'/%%'> ) } {<-e>} {(SQ <'s|\\.git/||'>)} ) ] negated: F ) ] ) ) } spids: [1166] ) ] ) (command.WhileUntil keyword: <Id.KW_While while> cond: [(command.Sentence child:(C {<read>} {<line>}) terminator:<Id.Op_Semi _>)] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name line> suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {<'*'> <Id.Lit_Slash />} ) ) } spids: [1214] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file2) op: assign_op.Equal rhs: {(${ Id.VSub_Name line)} spids: [1223] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:action) op: assign_op.Equal rhs: {<mv>} spids: [1229] ) ] ) (command.Simple words: [{<echo>} {<-n>} {(DQ ($ Id.VSub_DollarName '$file') <' '>)}] redirects: [ (redir.Redir op: <Id.Redir_GreatAnd '>&'> fd: -1 arg_word: {<2>} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$filelist'))}) (C {<grep>} { (DQ <'^'> (${ Id.VSub_Name file2) <Id.Lit_Other '$'> ) } ) (C {<head>} {<-n1>}) ] negated: F ) ] ) ) } spids: [1249] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {(DQ ($ Id.VSub_DollarName '$file_path'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$filelist'))} ) (C {<grep>} { (DQ <Id.Lit_Other '\\'> </> (${ Id.VSub_Name file) <Id.Lit_Other '$'> ) } ) (C {<head>} {<-n1>}) ] negated: F ) ] ) ) } spids: [1296] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$file_path'))} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] ) ] spids: [1279 1293] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:source_path) op: assign_op.Equal rhs: {(${ Id.VSub_Name FIRMWARE_EXTRA_DIR) </> (${ Id.VSub_Name file_path) } spids: [1347] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {<-f>} {(${ Id.VSub_Name source_path)} {<-o>} {<-h>} {(${ Id.VSub_Name source_path)} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:target_dir) op: assign_op.Equal rhs: {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </> (${ Id.VSub_Name file_path) } spids: [1380] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:target_dir) op: assign_op.Equal rhs: { (braced_var_sub token: <Id.VSub_Name target_dir> suffix_op: (suffix_op.Unary op_id: Id.VOp1_Percent arg_word: {<Id.Lit_Slash /> <'*'>} ) ) } spids: [1390] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {(DQ (${ Id.VSub_Name target_dir))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [(C {<mkdir>} {<-p>} {(${ Id.VSub_Name target_dir)})] spids: [1402 1420] ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {<-h>} {(DQ (${ Id.VSub_Name source_path))} {<-a>} {<-e>} {(DQ (${ Id.VSub_Name source_path))} {<Id.Lit_RBracket ']'>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SSIZE) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (C {($ Id.VSub_DollarName '$STAT')} {<-L>} {<-c>} {<Id.Lit_Other '%'> <s>} {(${ Id.VSub_Name source_path)} ) ] ) ) } spids: [1466] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SSIZE) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_Backtick '`'> command_list: (command.CommandList children: [ (C {<stat>} {<-c>} {<Id.Lit_Other '%'> <s>} {(${ Id.VSub_Name source_path)} ) ] ) ) } spids: [1486] ) ] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$SSIZE'))} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$SSIZE')} {<-gt>} {(DQ ($ Id.VSub_DollarName '$B'))} {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {<0>} spids: [1545] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-h>} {(DQ (${ Id.VSub_Name source_path))} {<Id.Lit_RBracket ']'>} ) (C {(${ Id.VSub_Name action)} {<-f>} {(${ Id.VSub_Name source_path)} {(${ Id.VSub_Name target_dir) </>} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [1582] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-e>} {(DQ (${ Id.VSub_Name source_path))} {<Id.Lit_RBracket ']'>} ) (C {(${ Id.VSub_Name action)} {<-f>} {(${ Id.VSub_Name source_path)} {(${ Id.VSub_Name target_dir) </>} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$ret')} ) right: (arith_expr.ArithWord w:{($ Id.VSub_QMark '$?')}) ) ) } spids: [1616] ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$ret')} {<-le>} {<1>} {<Id.Lit_RBracket ']'>} ) (C {<echo>} {(DQ (${ Id.VSub_Name file) <' SUCCESS'>)}) (C {<echo>} {(DQ (${ Id.VSub_Name file) <' FAIL'>)}) ] ) ] ) redirects: [ (redir.Redir op: <Id.Redir_Less '<'> fd: -1 arg_word: {($ Id.VSub_DollarName '$list')} ) ] ) ] ) redirects: [(redir.Redir op:<Id.Redir_DGreat '>>'> fd:-1 arg_word:{<fw-2.log>})] ) ] ) ) (command.ShFunction name: licence_func body: (command.BraceGroup children: [ (C {<echo>} {(DQ <'Extracting licences'>)}) (C {<mkdir>} {<-p>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </licences>}) (C {<find>} {(${ Id.VSub_Name SRC_FW_DIR)} {<-type>} {<f>} {<-iname>} {(SQ <'licen?e*'>)} {<-exec>} {<cp>} {(SQ <'{}'>)} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </licences>} {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\;'>)} ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$GIT_ALREADY_DOWNLOADED'))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <yes>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<func_git>}) (command.BraceGroup children: [ (command.Sentence child: (C {<echo>} {(DQ <ERROR>)}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) terminator: <Id.Op_Semi _> ) ] ) ] ) ] spids: [1748 1767] ) ] ) (C {<cd>} {(${ Id.VSub_Name CWD)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ ($ Id.VSub_DollarName '$DEST_FW_DIR'))} {<Id.Lit_RBracket ']'>} ) (C {<rm>} {<-rf>} {(DQ ($ Id.VSub_DollarName '$DEST_FW_DIR'))}) ] ) (C {<mkdir>} {<-p>} {(DQ ($ Id.VSub_DollarName '$DEST_FW_DIR'))}) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-f>} {(DQ (${ Id.VSub_Name FIRMWARE_SFS))} {<Id.Lit_RBracket ']'>}) (C {<rm>} {<-f>} {(${ Id.VSub_Name FIRMWARE_SFS)}) ] ) (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FW_FLAG) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [1856] ) ] ) terminator: <Id.Op_Semi _> ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {(DQ ($ Id.VSub_DollarName '$FW_FLAG'))} {<-a>} {<-z>} {(DQ ($ Id.VSub_DollarName '$CUTBYTES'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} {<-n>} { (DQ <'\n'> <'Cut down firmware?\n'> <'1. Cut down according to firmware.lst [default]\n'> <'2. Cut down according to built modules (needs work)\n'> <"3. Don't cut down\n"> <'\n'> <'Choose option: '> ) } ) terminator: <Id.Op_Semi _> ) (C {<read>} {<cdf>}) (command.Case to_match: {($ Id.VSub_DollarName '$cdf')} arms: [ (case_arm pat_list: [{<2>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FW_FLAG) op: assign_op.Equal rhs: {(DQ <big>)} spids: [1916] ) ] ) ] spids: [1913 1914 1921 -1] ) (case_arm pat_list: [{<3>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FW_FLAG) op: assign_op.Equal rhs: {(DQ <complete>)} spids: [1927] ) ] ) ] spids: [1924 1925 1932 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:FW_FLAG) op: assign_op.Equal rhs: {(DQ )} spids: [1938] ) ] ) ] spids: [1935 1936 1942 -1] ) ] ) ] spids: [1860 1882] ) ] ) (command.Case to_match: {($ Id.VSub_DollarName '$FW_FLAG')} arms: [ (case_arm pat_list: [{<complete>}] action: [ (C {<mkdir>} {<-p>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR)}) (C {<echo>} {(DQ <'Copy all firmware'>)}) (C {<cp>} {<-an>} {(${ Id.VSub_Name SRC_FW_DIR) </> <Id.Lit_Star '*'>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </>} ) (C {<rm>} {<-rf>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </.git>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </LICEN> <Id.Lit_Star '*'>} ) (C {<licence_func>}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ (${ Id.VSub_Name dest_kernel_package))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<cp>} {<-an>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </> <Id.Lit_Star '*'>} {(${ Id.VSub_Name dest_kernel_package) </>} ) (C {<rm>} {<-r>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR)}) ] spids: [2012 2028] ) ] else_action: [ (C {<mksquashfs>} {<zfirmware_workdir>} { (braced_var_sub token: <Id.VSub_Name FIRMWARE_SFS> suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {<'*'> <Id.Lit_Slash />} ) ) } {<-comp>} {<xz>} ) (command.Simple words: [ {<md5sum>} { (braced_var_sub token: <Id.VSub_Name FIRMWARE_SFS> suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {<'*'> <Id.Lit_Slash />} ) ) } ] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: { (braced_var_sub token: <Id.VSub_Name FIRMWARE_SFS> suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {<'*'> <Id.Lit_Slash />} ) ) <.md5.txt> } ) ] ) ] ) ] spids: [1957 1958 2098 -1] ) (case_arm pat_list: [{<big>}] action: [ (C {<echo>} {(DQ <'Extracting firmware'>)}) (C {<extract_firmware>}) (C {<echo>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:echo) op: assign_op.Equal rhs: {(DQ <'Not filtering'>)} spids: [2125] ) ] ) (C {<mv>} {(${ Id.VSub_Name FIRMWARE_EXTRA_DIR)} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR)}) (C {<licence_func>}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ (${ Id.VSub_Name dest_kernel_package))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<cp>} {<-n>} {<-r>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </> <Id.Lit_Star '*'>} {(${ Id.VSub_Name dest_kernel_package) </>} ) ] spids: [2145 2161] ) ] ) ] spids: [2101 2102 2185 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.Pipeline children: [ (C {<grep>} {(SQ <'^File'>)} {($ Id.VSub_DollarName '$SRC_FILE_FW')}) (C {<grep>} {<-oE>} {(SQ <'\\: [a-zA-Z].*|\\: L.*|\\: [0-9].*'>)}) (C {<sed>} {(SQ <'s/^\\: //'>)}) (command.Simple words: [{<grep>} {<-vE>} {(SQ <'liquidio|cxgb[34]|phanfw.bin'>)}] redirects: [(redir.Redir op:<Id.Redir_Great '>'> fd:-1 arg_word:{<firmware.lst>})] ) ] negated: F ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {(DQ ($ Id.VSub_DollarName '$CUTBYTES'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Sentence child: (C {<echo>} {<-n>} { (DQ <'\n'> <'Cut down firmware more?\n'> < '1. Cut down with some big, mostly obscure firmware removed (default)\n' > <'2. Cut down eliminating fw bigger than 1.5MB - usually safe\n'> < '3. Cut down eliminating fw bigger than 1MB - may cut wifi support\n' > <'4. Cut down eliminating fw bigger than 500KB - use at own risk\n'> <'5. Cut down eliminating fw bigger than 250KB - are you insane?\n'> <'\n'> <'Choose option: '> ) } ) terminator: <Id.Op_Semi _> ) (C {<read>} {<cdfplus>}) (command.Case to_match: {($ Id.VSub_DollarName '$cdfplus')} arms: [ (case_arm pat_list: [{<2>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CUTBYTES) op: assign_op.Equal rhs: {<1500000>} spids: [2288] ) ] ) ] spids: [2285 2286 2291 -1] ) (case_arm pat_list: [{<3>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CUTBYTES) op: assign_op.Equal rhs: {<1000000>} spids: [2297] ) ] ) ] spids: [2294 2295 2300 -1] ) (case_arm pat_list: [{<4>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CUTBYTES) op: assign_op.Equal rhs: {<500000>} spids: [2306] ) ] ) ] spids: [2303 2304 2309 -1] ) (case_arm pat_list: [{<5>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CUTBYTES) op: assign_op.Equal rhs: {<250000>} spids: [2315] ) ] ) ] spids: [2312 2313 2318 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CUTBYTES) op: assign_op.Equal rhs: {<0>} spids: [2324] ) ] ) ] spids: [2321 2322 2327 -1] ) ] ) ] spids: [2240 2252] ) ] ) (C {<echo>} {(DQ <'Extracting firmware'>)}) (C {<extract_firmware>}) (C {<echo>}) (C {<fw_filter>} {<firmware.lst>} {($ Id.VSub_DollarName '$CUTBYTES')}) (C {<find>} {(${ Id.VSub_Name FIRMWARE_EXTRA_DIR)} {<-type>} {<d>} {<-empty>} {<-delete>}) (C {<licence_func>}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ (${ Id.VSub_Name dest_kernel_package))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<cp>} {<-n>} {<-r>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR) </> <Id.Lit_Star '*'>} {(${ Id.VSub_Name dest_kernel_package) </>} ) ] spids: [2381 2397] ) ] ) (C {<rm>} {<-r>} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR)}) (C {<mv>} {(${ Id.VSub_Name FIRMWARE_EXTRA_DIR)} {(${ Id.VSub_Name FIRMWARE_RESULT_DIR)}) (C {<mksquashfs>} {<zfirmware_workdir>} {(${ Id.VSub_Name FIRMWARE_SFS)} {<-comp>} {<xz>}) (command.Simple words: [{<md5sum>} {(${ Id.VSub_Name FIRMWARE_SFS)}] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {(${ Id.VSub_Name FIRMWARE_SFS) <.md5.txt>} ) ] ) ] spids: [2188 2189 2472 -1] ) ] ) (command.Subshell command_list: (command.CommandList children: [ (C {<echo>} {(SQ <'================'>)}) (C {<echo>} {(DQ <'FIRMWARE IN FDRV'>)}) (C {<echo>} {(SQ <'================'>)}) (C {<cat>} {<fw-1.log>}) (C {<echo>} {(SQ <'=============================='>)}) (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} {<-f>} {(${ Id.VSub_Name list) <.log>} {<Id.Lit_RBracket ']'>}) (C {<cat>} {(${ Id.VSub_Name list) <.log>}) (C {<rm>} {(${ Id.VSub_Name list) <.log>}) ] ) ] ) redirects: [(redir.Redir op:<Id.Redir_AndDGreat '&>>'> fd:-1 arg_word:{<build.log>})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_DollarName '$DEBUG')} {<-ne>} {<1>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<rm>} {<-f>} {<fw-> <Id.Lit_Star '*'> <.log>}) (C {<rm>} {<-rf>} {<zfirmware_workdir>}) ] spids: [2552 2566] ) ] ) (C {<echo>} {(DQ <'Firmware script complete.'>)}) ] )