From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=anoo@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 468YZg3ccVzDr3r for ; Fri, 16 Aug 2019 03:38:18 +1000 (AEST) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7FHbVOm121797 for ; Thu, 15 Aug 2019 13:38:13 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ud9acppk3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 15 Aug 2019 13:38:12 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Aug 2019 18:38:10 +0100 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 15 Aug 2019 18:38:08 +0100 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7FHc7Qn52560254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Aug 2019 17:38:07 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9F8E8112062 for ; Thu, 15 Aug 2019 17:38:07 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 63E43112061 for ; Thu, 15 Aug 2019 17:38:07 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.16.170.189]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP for ; Thu, 15 Aug 2019 17:38:07 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 15 Aug 2019 12:38:16 -0500 From: Adriana Kobylak To: openbmc@lists.ozlabs.org Subject: Alternative to the filesystem overlay X-Sender: anoo@linux.ibm.com User-Agent: Roundcube Webmail/1.0.1 X-TM-AS-GCONF: 00 x-cbid: 19081517-0052-0000-0000-000003EB2969 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011594; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01247265; UDB=6.00658258; IPR=6.01028772; MB=3.00028186; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-15 17:38:09 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081517-0053-0000-0000-0000621B0461 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-08-15_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908150170 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2019 17:38:20 -0000 In OpenBMC we've been using an overlay to make the read-only filesystem (or part of it) writable. It hasn't come without its issues, like missing directories (openbmc/openbmc#3564) and various flavors of corruption (openbmc/openbmc#3578 and issues when adding files to /etc in the build causing files that had been previously modified on the bmc to become corrupted). An alternative would be to use a bind mount and manage the file merging by an OpenBMC app. Doing some experimentation, seems this solves the issues seen above. The way that it'd work would be: - The init script or initramfs would do an rsync from /etc to the bind mount destination directory in the read-write filesystem, skipping the contents of a list which would contain the files that have been modified in the BMC and should be preserved. - A new OpenBMC app would monitor /etc for changes via inotify for example, and if a file is modified, it'd add it to the "list". Considerations: - The /etc dir mainly being a configuration destination does not get modified often so the app that is watching the directory would not be triggered often. - The bind mount would duplicate the contents of etc although it's not much. If space is a concern, some exploration could be done to have the bind mount be a tmpfs and have the monitor app copy the modified files to the read-write filesystem instead of adding them to a list. Thoughts?