From patchwork Sun Aug 4 12:14:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1141728 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HBCHnulx"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 461fwD5YwSz9sMr for ; Sun, 4 Aug 2019 22:14:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D24BF8776C; Sun, 4 Aug 2019 12:14:31 +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 L41Kki5K9587; Sun, 4 Aug 2019 12:14:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 921BD87A4F; Sun, 4 Aug 2019 12:14:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 57D4B1BF417 for ; Sun, 4 Aug 2019 12:14:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5104D8598E for ; Sun, 4 Aug 2019 12:14:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EUmpTEqQJJf3 for ; Sun, 4 Aug 2019 12:14:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6525F858B8 for ; Sun, 4 Aug 2019 12:14:23 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id n9so81765212wru.0 for ; Sun, 04 Aug 2019 05:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eY89aFOUsT2zo4zMxSfjwKsRRnkoJ1ObJYVUGj1xm6Q=; b=HBCHnulx4wY2pkMwup6ICgNr7GLNPXFhEuSD4YYT2+5Xs/SUdeDXya/6n1EDW1GezQ 5qkfyHPnQoFScE4tDobGaME+seXLEVVcUizkC0lCUjO3WN/1HFxruCrfk15bdJgiunds wFtFK0YEbbAoHMvoU8btzHh5qisUOOXwnj/vWBwhWPaClzodiA+3rtsMX0r2VytU7Fxu wCfau9+X2pa7YrEt12VhaHU3br8ra2jEYj1PfDqEYq/Uy5oN1V0loZjWKY9wvTqzbjVI 6wNjDRmjdLEWAsDLz7OUIVPUlHL9eyD+CWoax4tue0/0Zclt/v6dhcLMKEuncBJi56C+ XqTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eY89aFOUsT2zo4zMxSfjwKsRRnkoJ1ObJYVUGj1xm6Q=; b=AgeriN+8sAyBKFaaAIMxdSQIg7gEFjfIWaKddcFID1UnTNzB9h7HUMfSi46qdHs/rk VjlkWqQgYTzLIzrhd/O4YnDFk0EjPD2Hyl21oIN5cRUjzg/sULMQLZCKvqOvJxJRrvVY K32GQXehgdzKBKcxSHmg0BsnHroXp96p3Qy3swmiMRtw9NA0Ag8phcqwrfehT5TlzQ7X rZBFYuzlJ9u1tEM3qWzVi1qvtZyMQalqdgqGijQuP5TnlAQei7YgQgowWsCI8lmv8Jlj 9SYhiSI765TXAcH7EExosiPqIpTxulwd/CMYc3bxBTGGuOarT6qJucb5bLA6JVUL0kfh dkvQ== X-Gm-Message-State: APjAAAVDbxqsL4QMA/uNTNIFReTzK7sIyh5zCMfEidZuwhILbejw07ek 9uICNSrPusg36W1pUH9zM8QVYwPt X-Google-Smtp-Source: APXvYqxdqz88dBEsbsLZ9DP5SsG9/KnA331RWN09x+eReRvlCjSan+dzuE1DoPgRN6Lq8PnRvq8Sdg== X-Received: by 2002:a05:6000:187:: with SMTP id p7mr31986047wrx.189.1564920861745; Sun, 04 Aug 2019 05:14:21 -0700 (PDT) Received: from scaer.home (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id u1sm76939800wml.14.2019.08.04.05.14.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 04 Aug 2019 05:14:21 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sun, 4 Aug 2019 14:14:16 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/5 v3] package/skeleton-init-openrc: add support to remount rootfs as rw X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E . MORIN" , =?utf-8?b?TWljaGHFgiDFgXlz?= =?utf-8?q?zczek?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Michał Łyszczek Add a pseudo entry for /dev/root in fstab, to tell openrc to prperly remount or not remount / read-write. For consistency with systemd (which is the only other init system to tweak an fstab basd on / being rw or not), we do this change in the openrc skeleton rahter than in the openrc package. Signed-off-by: Michał Łyszczek [yann.morin.1998@free.fr: - tweak the sed expressions - reword commit log ] Signed-off-by: Yann E. MORIN --- .../skeleton-init-openrc/skeleton-init-openrc.mk | 15 +++++++++++++++ package/skeleton-init-openrc/skeleton/etc/fstab | 1 + 2 files changed, 16 insertions(+) diff --git a/package/skeleton-init-openrc/skeleton-init-openrc.mk b/package/skeleton-init-openrc/skeleton-init-openrc.mk index 5ee2192093..656fc531d7 100644 --- a/package/skeleton-init-openrc/skeleton-init-openrc.mk +++ b/package/skeleton-init-openrc/skeleton-init-openrc.mk @@ -15,8 +15,23 @@ SKELETON_INIT_OPENRC_DEPENDENCIES = skeleton-init-common SKELETON_INIT_OPENRC_PROVIDES = skeleton +ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y) +# Comment /dev/root entry in fstab. When openrc does not find fstab entry for +# "/", it will try to remount "/" as "rw". +define SKELETON_INIT_OPENRC_ROOT_RO_OR_RW + $(SED) '\:^/dev/root :s/^/# /' $(TARGET_DIR)/etc/fstab +endef +else +# Uncomment /dev/root entry in fstab which has "ro" option so openrc notices +# it and doesn't remount root to rw. +define SKELETON_INIT_OPENRC_ROOT_RO_OR_RW + $(SED) '\:^# /dev/root:s/^# //' $(TARGET_DIR)/etc/fstab +endef +endif # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW + define SKELETON_INIT_OPENRC_INSTALL_TARGET_CMDS $(call SYSTEM_RSYNC,$(SKELETON_INIT_OPENRC_PKGDIR)/skeleton,$(TARGET_DIR)) + $(SKELETON_INIT_OPENRC_ROOT_RO_OR_RW) endef $(eval $(generic-package)) diff --git a/package/skeleton-init-openrc/skeleton/etc/fstab b/package/skeleton-init-openrc/skeleton/etc/fstab index 3ec96cf634..21cf49ba5a 100644 --- a/package/skeleton-init-openrc/skeleton/etc/fstab +++ b/package/skeleton-init-openrc/skeleton/etc/fstab @@ -1,3 +1,4 @@ # +/dev/root / ext2 ro,noauto 0 0 tmpfs /tmp tmpfs mode=1777 0 0 tmpfs /run tmpfs mode=0755,nosuid,nodev 0 0