From patchwork Tue Nov 27 08:12:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeremy Rosen X-Patchwork-Id: 202112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 1393A2C008E for ; Tue, 27 Nov 2012 19:14:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 215B2A00B6; Tue, 27 Nov 2012 08:14:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FJUfRD1yaqlD; Tue, 27 Nov 2012 08:14:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id AF93CA00C4; Tue, 27 Nov 2012 08:14:04 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AACBD8F74A for ; Tue, 27 Nov 2012 08:14:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C2CAC81492 for ; Tue, 27 Nov 2012 08:14:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3wGFrWam6e9W for ; Tue, 27 Nov 2012 08:14:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from zimbra3.corp.accelance.fr (zimbra3.corp.accelance.fr [213.162.49.233]) by whitealder.osuosl.org (Postfix) with ESMTP id A251A80C12 for ; Tue, 27 Nov 2012 08:14:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra3.corp.accelance.fr (Postfix) with ESMTP id 6058B28004 for ; Tue, 27 Nov 2012 09:14:00 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra3.corp.accelance.fr Received: from zimbra3.corp.accelance.fr ([127.0.0.1]) by localhost (zimbra3.corp.accelance.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i1-ADq20Ic1r; Tue, 27 Nov 2012 09:13:55 +0100 (CET) Received: from pcrosen.daviel.openwide.fr. (unknown [193.56.60.160]) by zimbra3.corp.accelance.fr (Postfix) with ESMTPSA id 94C2028045; Tue, 27 Nov 2012 09:13:55 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= To: buildroot@busybox.net Date: Tue, 27 Nov 2012 09:12:33 +0100 Message-Id: <1354003953-10875-1-git-send-email-jeremy.rosen@openwide.fr> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] [PATCH][RFC] new target: live filesystem X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net add a new target to deploy a live filesystem to be used by NFS --- Hello everybody this patch is not ready for commit, it's a proposal to help me solve the very common use case of a developement FS deployed on NFS. I am not very happy of how it's done at this point but I would like to discuss it to see if it has a chance to get merged... What I don't like (and would gladly have ideas on how to solve this) * no dependency on host-sudo, i'm not sure how to add that * using sudo to break out of fakeroot is not clean * I am abusing the fs building framework, but I don't know of a cleaner way * filesystem can only be under output/images at this point so this patch is more to start a discussion than anything, i'll gladly take any comments or plain 'ol rejection if the project doesn't want it... but if there is some interest i'll work it into something mainline worthy Regards Jérémy Rosen --- fs/Config.in | 1 + fs/live/Config.in | 16 ++++++++++++++++ fs/live/live.mk | 23 +++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 fs/live/Config.in create mode 100644 fs/live/live.mk diff --git a/fs/Config.in b/fs/Config.in index 94154ea..de2377e 100644 --- a/fs/Config.in +++ b/fs/Config.in @@ -11,5 +11,6 @@ source "fs/cpio/Config.in" source "fs/iso9660/Config.in" source "fs/initramfs/Config.in" source "fs/romfs/Config.in" +source "fs/live/Config.in" endmenu diff --git a/fs/live/Config.in b/fs/live/Config.in new file mode 100644 index 0000000..bf24754 --- /dev/null +++ b/fs/live/Config.in @@ -0,0 +1,16 @@ +config BR2_TARGET_ROOTFS_LIVE + bool "live root filesystem" + help + uses sudo to create a live image of the filesystem + this is mainly usefull if you want to use your filesystem + over NFS +config BR2_TARGET_ROOTFS_LIVE_DEST + string "directory to put the live image" + depends on BR2_TARGET_ROOTFS_LIVE + default "live" + help + The directory where the image should be stored. + this directory will be emptied and recreated, it is given + relative to the buildroot output/images directory + + diff --git a/fs/live/live.mk b/fs/live/live.mk new file mode 100644 index 0000000..73bcd3e --- /dev/null +++ b/fs/live/live.mk @@ -0,0 +1,23 @@ +############################################################# +# +# Build the live root filesystem directory +# +############################################################# + +LIVE_OPTS := + + +ROOTFS_LIVE_DEPENDENCIES = #host-sudo + +define ROOTFS_LIVE_CMD + sudo cp -r $(TARGET_DIR)/* $(BINARIES_DIR)/$(BR2_TARGET_ROOTFS_LIVE_DEST)/ +endef + +define ROOTFS_LIVE_INIT + sudo rm -rf $(BINARIES_DIR)/$(BR2_TARGET_ROOTFS_LIVE_DEST) + sudo mkdir $(BINARIES_DIR)/$(BR2_TARGET_ROOTFS_LIVE_DEST) +endef + +ROOTFS_LIVE_PRE_GEN_HOOKS += ROOTFS_LIVE_INIT + +$(eval $(call ROOTFS_TARGET,live))