From owner-freebsd-arch@FreeBSD.ORG Sun Sep 19 23:46:46 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20583106564A; Sun, 19 Sep 2010 23:46:46 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 800948FC1A; Sun, 19 Sep 2010 23:46:45 +0000 (UTC) Received: by fxm9 with SMTP id 9so504430fxm.13 for ; Sun, 19 Sep 2010 16:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=oF/W1e25sMaehEvpHzBMx7JSMRLrUmoKwcpwIzGrdxs=; b=AzVzR0Lknet5J1ryzE4AnOjuEi/7Lglfp33uJUGps4rE+vj+3usCPkkUHgBPa273kL NSqa0qNGihm4nbhixM+8QekllDOPH/ur0Kzo/+wxeNxR8y2mPePx92N7PUgfP46JdR0N 0sfQ5zxtXSM1mGQl6hO7kJgPgB0gBt9ad8h1w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=MJ3cp8j18jajXJbqWuVYKNpj7Jk//5xyLbCk81pVPbif1jNMJqL2f73O7rNvL2fnyX Eh6FQig24UILbMHIvJRLd2cJ0T/YywC1eHYBJMeaF6mY10nvPFk7gp2DWXU1y1Q/Lw5S Eb2rCh9GMQ4dF/4KC62LwQRa60t0EevAypki4= MIME-Version: 1.0 Received: by 10.103.138.4 with SMTP id q4mr452924mun.26.1284938258957; Sun, 19 Sep 2010 16:17:38 -0700 (PDT) Received: by 10.102.23.19 with HTTP; Sun, 19 Sep 2010 16:17:38 -0700 (PDT) In-Reply-To: <16411667@ipt.ru> References: <20100917234542.GE1902@garage.freebsd.pl> <16411667@ipt.ru> Date: Mon, 20 Sep 2010 01:17:38 +0200 Message-ID: From: Oliver Pinter To: Boris Samorodov Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current@freebsd.org, Pawel Jakub Dawidek , freebsd-arch@freebsd.org Subject: Re: gptboot rewrite, bootonce, etc. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2010 23:46:46 -0000 Hi PJD! Can you this patcheset release for 7-STABLE? On 9/19/10, Boris Samorodov wrote: > Hi! > > On Sat, 18 Sep 2010 01:45:42 +0200 Pawel Jakub Dawidek wrote: > >> My company was in need for functionality similar to nextboot(8), but on >> boot loader level, so we can have two partitions we boot from where one >> is known to be good and the other is used for upgrades. We upgrade by >> dd(1)ing entire partition image onto unused partition, we mark it as >> try-to-boot-from-it-but-only-once, reboot and if we fail to boot from >> the new partition, we fall back to the old, good partition. If we >> succeed on the other hand, we mark the new partition as our boot >> partition and mark the other one as unused. > >> Well, how hard can it be? > >> After around two weeks of work, I ended up rewriting gptboot in large >> parts, reorganizing a lot of code, improving and extending gpart a bit >> and implementing desire functionality. > >> Here is the patch for review and test: > >> http://people.freebsd.org/~pjd/patches/gptboot.patch > > Great! Since I need to have both i386 and amd64 at my box > here are my test results: > ----- > [~]bsam@alya% uname -a > FreeBSD alya 9.0-CURRENT FreeBSD 9.0-CURRENT #1 r212758M: Sat Sep 18 > 16:13:38 MSD 2010 > bsam@alya:/space/FreeBSD/base/head/obj/space/FreeBSD/base/head/src/sys/ALYA > amd64 > > [~]bsam@alya% glabel status > Name Status Components > gptid/c6053c9b-abcc-11df-b740-00251124aff4 N/A ad4p1 > label/9-amd64 N/A ad4p2 > label/swap N/A ad4p3 > label/space N/A ad4p4 > label/9-i386 N/A ad4p5 > [~]bsam@alya% mount > /dev/label/9-amd64 on / (ufs, local) > devfs on /dev (devfs, local, multilabel) > /dev/label/space on /space (ufs, local) > /dev/md0 on /tmp (ufs, local, nosuid, soft-updates) > procfs on /proc (procfs, local) > linprocfs on /compat/linux/proc (linprocfs, local) > linsysfs on /compat/linux/sys (linsysfs, local) > fdescfs on /dev/fd (fdescfs) > > [~]bsam@alya% gpart show > => 34 490234685 ad4 GPT (234G) > 34 128 1 freebsd-boot (64K) > 162 41943040 2 freebsd-ufs (20G) > 41943202 8388608 3 freebsd-swap (4.0G) > 50331810 209715200 4 freebsd-ufs (100G) > 260047010 41943040 5 freebsd-ufs (20G) > 301990050 188244669 - free - (90G) > > [~]bsam@alya% gpart set -a bootme -i 2 ad4 > bootme set on ad4p2 > [~]bsam@alya% gpart set -a bootonce -i 5 ad4 > bootonce set on ad4p5 > [~]bsam@alya% gpart show > => 34 490234685 ad4 GPT (234G) > 34 128 1 freebsd-boot (64K) > 162 41943040 2 freebsd-ufs [bootme] (20G) > 41943202 8388608 3 freebsd-swap (4.0G) > 50331810 209715200 4 freebsd-ufs (100G) > 260047010 41943040 5 freebsd-ufs [bootonce,bootme] (20G) > 301990050 188244669 - free - (90G) > ----- > > Install i386 kernel/world to ad4p5, successful reboot, get i386 > system. Next reboot (get amd64 system back): > ----- > [~]bsam@alya% gpart show > => 34 490234685 ad4 GPT (234G) > 34 128 1 freebsd-boot (64K) > 162 41943040 2 freebsd-ufs [bootme] (20G) > 41943202 8388608 3 freebsd-swap (4.0G) > 50331810 209715200 4 freebsd-ufs (100G) > 260047010 41943040 5 freebsd-ufs (20G) > 301990050 188244669 - free - (90G) > ----- > > All seems to work fine. > >> Any comments or suggestions? > > Only one for now. With current default syslog configuration > logging to local0.warning and local0.info goes nowhere. > It will be good if those messages have traces at the > default system. > > > Thank you! That's really great. > > -- > WBR, Boris Samorodov (bsam) > Research Engineer, http://www.ipt.ru Telephone & Internet SP > FreeBSD Committer, http://www.FreeBSD.org The Power To Serve > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >