Commit Graph

6 Commits

Author SHA1 Message Date
Aleksa Sarai 7b0c6e035a
*: fix shfmt
Recent changes in upstream shfmt have started causing our scripts to no
longer be "correctly formatted". Fix up with `shfmt -w`.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2017-07-04 01:44:16 +10:00
Christy Perez 9ed7e9b176 shfmt'ing files
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2017-05-24 16:43:08 -05:00
Daniel Martí cdb66f5421 Run shfmt on all shell files 2016-11-17 11:51:12 +00:00
Zhao Lei a9ec7c631c [check-config] No warning in blank argument
If user run current script whthout argument, the script will search
config in default dir list, but output following message:
 | # script/check-config.sh
 | warning: /proc/config.gz seems not a kernel config, searching other paths for kernel config ...
            ^^^^^^^^^^^^^^^
 | info: reading kernel config from /boot/config-4.7.0_HEAD_523d939ef98fd712632d93a5a2b588e477a7565e_ ...
 | ...

We can make output better by restruct the code struct:
1: Specify nothing
   Show info, and search default dir
2: Specify a config file
   Use it directly
3: Specify a wrong config file
   Show warning, and search default dir
4: Specify a dir
   Info, and search specified dir

Test:
 | # script/check-config.sh
 | info: no config specified, searching for kernel config ...
 | info: reading kernel config from /boot/config-4.7.0_HEAD_523d939ef98fd712632d93a5a2b588e477a7565e_ ...
 |
 | # script/check-config.sh /linux/.config
 | info: reading kernel config from /linux/.config ...
 |
 | # script/check-config.sh /linux/.configgg
 | warning: /linux/.configgg seems not a kernel config, searching other paths for kernel config ...
 | info: reading kernel config from /boot/config-4.7.0_HEAD_523d939ef98fd712632d93a5a2b588e477a7565e_ ...
 |
 | # script/check-config.sh /linux
 | info: input is a directory, searching for kernel config in this directory...
 | info: reading kernel config from /linux/.config ...
 |

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-09-06 16:29:43 +08:00
Zhao Lei 6683e16c03 [check-config] Search possible files in dir
If we give a dir as argument for check-config, it will treat the
dir as a config file, and grep config contents from the dir,
and get wrong result, as:
 | # script/check-config.sh /linux
 | info: reading kernel config from /linux ...
 |
 | Generally Necessary:
 | - cgroup hierarchy: properly mounted [/sys/fs/cgroup]
 | - CONFIG_NAMESPACES: missing
 | - CONFIG_NET_NS: missing
 | - CONFIG_PID_NS: missing
 | - CONFIG_IPC_NS: missing
 | - CONFIG_UTS_NS: missing
 | - CONFIG_CGROUPS: missing
 | - CONFIG_CGROUP_CPUACCT: missing
 | - CONFIG_CGROUP_DEVICE: missing
 | - CONFIG_CGROUP_FREEZER: missing
 | - CONFIG_CGROUP_SCHED: missing
 | ...

We can search possible config files in the dir,
after patch:
 | # script/check-config.sh /linux
 | warning: /linux seems not a kernel config, searching other paths for kernel config ...
 | info: reading kernel config from /linux/.config ...
 |
 | Generally Necessary:
 | - cgroup hierarchy: properly mounted [/sys/fs/cgroup]
 | - CONFIG_NAMESPACES: enabled
 | - CONFIG_NET_NS: enabled
 | - CONFIG_PID_NS: enabled
 | - CONFIG_IPC_NS: enabled
 | - CONFIG_UTS_NS: enabled
 | - CONFIG_CGROUPS: enabled
 | - CONFIG_CGROUP_CPUACCT: enabled
 | - CONFIG_CGROUP_DEVICE: enabled
 | - CONFIG_CGROUP_FREEZER: enabled
 | - CONFIG_CGROUP_SCHED: enabled
 | ...

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-09-06 15:54:45 +08:00
Qiang Huang a04c569b90 Add check_config.sh for runc
It copied from docker and removed unnecessary configs.

Closes: https://github.com/opencontainers/runc/issues/819

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-05-16 19:15:45 +08:00