Lucas Meneghel Rodrigues | 26 Jun 2012 04:13
Picon
Favicon
Gravatar

[PATCH] client.kernel_config: Uncompress /proc/config.gz and use as cfg

For systems that support /proc/config.gz, we can use the
config only if it's properly uncompressed. So, uncompress
the config file, and then pass it to autotest.

Signed-off-by: Lucas Meneghel Rodrigues <lmr <at> redhat.com>
---
 client/kernel_config.py |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/client/kernel_config.py b/client/kernel_config.py
index 20b6fb9..bb5b226 100644
--- a/client/kernel_config.py
+++ b/client/kernel_config.py
 <at>  <at>  -73,6 +73,9  <at>  <at>  class kernel_config(object):
         running_config = utils.running_config()
         if running_config is None:
             running_config = ''
+        if running_config.endswith('.gz'):
+            utils.system('cat %s | gzip > /tmp/running-config')
+            running_config = '/tmp/running_config'
         self.running_config = running_config

         # 1. Get original config file
--

-- 
1.7.10.2
Lucas Meneghel Rodrigues | 26 Jun 2012 04:49
Picon
Favicon
Gravatar

Re: [PATCH] client.kernel_config: Uncompress /proc/config.gz and use as cfg

On Mon, 2012-06-25 at 23:13 -0300, Lucas Meneghel Rodrigues wrote:
> For systems that support /proc/config.gz, we can use the
> config only if it's properly uncompressed. So, uncompress
> the config file, and then pass it to autotest.

Sorry about this, it has some glaring bugs and I'll update it here as
soon as I get everything tested. Just ignore it :)

> Signed-off-by: Lucas Meneghel Rodrigues <lmr <at> redhat.com>
> ---
>  client/kernel_config.py |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/client/kernel_config.py b/client/kernel_config.py
> index 20b6fb9..bb5b226 100644
> --- a/client/kernel_config.py
> +++ b/client/kernel_config.py
>  <at>  <at>  -73,6 +73,9  <at>  <at>  class kernel_config(object):
>          running_config = utils.running_config()
>          if running_config is None:
>              running_config = ''
> +        if running_config.endswith('.gz'):
> +            utils.system('cat %s | gzip > /tmp/running-config')
> +            running_config = '/tmp/running_config'
>          self.running_config = running_config
>  
>          # 1. Get original config file

Gmane