Date: Sat, 8 Dec 2012 06:09:49 -0800 (PST) From: Jack Mc Lauren <jack.mclauren@yahoo.com> To: Aleksandr Rybalko <ray@freebsd.org> Cc: "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org> Subject: Re: compressing nanoBSD image Message-ID: <1354975789.32487.YahooMailNeo@web160106.mail.bf1.yahoo.com> In-Reply-To: <20121208154907.e642ba5b.ray@freebsd.org> References: <1354956680.94571.YahooMailNeo@web160104.mail.bf1.yahoo.com> <20121208154907.e642ba5b.ray@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> Hi all=0A=0A> =0A> Are there any ways to compress the nanoBSD image and d= ecompress it at=0A> boot time ?=0A> =0A> Thank u all=A0=0A=0A>>Hi!=0A>>=0A>= >you can use mkuzip/mkulzma and geom_uncompress in kernel.=0A>>But Read-onl= y of course. =0A>>=0A>>WBW=0A>>-- =0A=0AThank you so much.=0ACan you help m= e with an example please ?=0A=0AThanks From owner-freebsd-embedded@FreeBSD.ORG Sat Dec 8 23:19:55 2012 Return-Path: <owner-freebsd-embedded@FreeBSD.ORG> Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34FBB910 for <freebsd-embedded@freebsd.org>; Sat, 8 Dec 2012 23:19:55 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id D5E438FC12 for <freebsd-embedded@freebsd.org>; Sat, 8 Dec 2012 23:19:54 +0000 (UTC) Received: from rnote.ddteam.net (184-57-135-95.pool.ukrtel.net [95.135.57.184]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 30CD5C4927; Sun, 9 Dec 2012 01:19:53 +0200 (EET) Date: Sun, 9 Dec 2012 01:19:44 +0200 From: Aleksandr Rybalko <ray@freebsd.org> To: Jack Mc Lauren <jack.mclauren@yahoo.com> Subject: Re: compressing nanoBSD image Message-Id: <20121209011944.8d888866.ray@freebsd.org> In-Reply-To: <1354975789.32487.YahooMailNeo@web160106.mail.bf1.yahoo.com> References: <1354956680.94571.YahooMailNeo@web160104.mail.bf1.yahoo.com> <20121208154907.e642ba5b.ray@freebsd.org> <1354975789.32487.YahooMailNeo@web160106.mail.bf1.yahoo.com> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org> X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems <freebsd-embedded.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-embedded>, <mailto:freebsd-embedded-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-embedded> List-Post: <mailto:freebsd-embedded@freebsd.org> List-Help: <mailto:freebsd-embedded-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-embedded>, <mailto:freebsd-embedded-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sat, 08 Dec 2012 23:19:55 -0000 On Sat, 8 Dec 2012 06:09:49 -0800 (PST) Jack Mc Lauren <jack.mclauren@yahoo.com> wrote: > > Hi all > > > > > Are there any ways to compress the nanoBSD image and decompress it > > at boot time ? > > > > Thank u allĀ > > >>Hi! > >> > >>you can use mkuzip/mkulzma and geom_uncompress in kernel. > >>But Read-only of course. > >> > >>WBW > >>-- > > Thank you so much. > Can you help me with an example please ? > > Thanks Yeah, sure! Assume you have rootfs dir, then makefs -d 255 -t cd9660 -o "rockridge" rootfs.iso rootfs mkulzma -v rootfs.iso.ulzma -s 131072 rootfs.iso So now you have rootfs.iso.ulzma which is rootfs files in the ISO9660 filesystem packed into ulzma (each block compressed with LZMA) so you have to have already loaded kernel with geom_uncompress inside and that image at begin of any attached to system media, or on some partition/slice of media. For example, if you have only CF card to boot, you need way to load kernel first. You can put kernel on separate partition (since ulzma inaccessible yet, till kernel started), or depend on loader(BIOS) ability it can be even some blocks of card w/o any FS. Then when kernel done attaching media, GEOM inspect meta info on it, parse partitions, find header of ulzma and attach it as "something.uncompress". If you put rootfs.iso.ulzma into /dev/da0s2, then it appear as /dev/da0s2.uncompress, and you will able to mount it with mount -t cd9660 /dev/da0s2.uncompress /dir. etc. WBW -- Aleksandr Rybalko <ray@freebsd.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1354975789.32487.YahooMailNeo>