Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IGzgB-0005bU-8e for mharc-grub-devel@gnu.org; Fri, 03 Aug 2007 12:07:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IGzg9-0005aW-Js for grub-devel@gnu.org; Fri, 03 Aug 2007 12:07:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IGzg5-0005Yn-TB for grub-devel@gnu.org; Fri, 03 Aug 2007 12:07:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IGzg5-0005Yh-OX for grub-devel@gnu.org; Fri, 03 Aug 2007 12:07:01 -0400 Received: from py-out-1112.google.com ([64.233.166.178]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IGzg4-0003eC-BV for grub-devel@gnu.org; Fri, 03 Aug 2007 12:07:00 -0400 Received: by py-out-1112.google.com with SMTP id f31so1664279pyh for ; Fri, 03 Aug 2007 09:06:29 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=H2/y6ErHB7ms+2gVzFI9eZ4JzF73hHATidHaJ6cgAzDjCS69x3xqqbU2iaOe/SXgeUG+8hVb50I3yYNy7BxQant5eYvXdld3EaAGA1FksTGcFWNkbBwGEsDAKxn+aT5384znExHTedCvBoKtYOgg/9MfBT4/zEMB8CFDjG8tmxk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=B7Ek7WIq2js7ltPX91e6sWsBkrufjs1uaY8g3y9m9KG4F5LL0evO7Bs0+xO5OMB0pKtQHIp0f5Ra0OoKvveAnq4gIgNk8yLIQ9OfCNJKrQE/skizilhJdo7SfP4kXp3uRT75RoejvE5f1xwUJmP/DvlIqkrDTQBWeUQv7/T10PQ= Received: by 10.65.234.2 with SMTP id l2mr5343449qbr.1186157188804; Fri, 03 Aug 2007 09:06:28 -0700 (PDT) Received: by 10.64.48.11 with HTTP; Fri, 3 Aug 2007 09:06:28 -0700 (PDT) Message-ID: Date: Sat, 4 Aug 2007 00:06:28 +0800 From: Bean To: "The development of GRUB 2" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Detected-Kernel: Linux 2.6 (newer, 2) Subject: Transparent decompression with file system filter X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2007 16:07:05 -0000 Currently, grub2 support gziped file with the gzio module. To open a gziped file, you have to use a special function grub_gzfile_open, I think it could be better if grub_file_open could handle compressed file transparently. The implementation is actually quite simple. We define a file system filter interface, modules can use it to register its filter. Then, as the last step of opening a file, we can the filters. If a filter recognized the file format, it will create a new file object to represent the file. If none of the filter want to handle this file, the orginal file object is used. We can add a new function grub_file_rawopen, which will always skip the filters. We can also use variable to control behavior, for example, if nocomp=1, no filter is called. The advantage of this scheme is that it's extensible. For example. if we want to support bzip2 format, we just need to add a new decompression filter. -- Bean