From c3fa29ca201d3ab2686c53a0ed62a443e8a5a921 Mon Sep 17 00:00:00 2001 From: renlin Date: Sat, 8 Jul 2023 18:37:33 +0800 Subject: [PATCH] add logic to move etc/var mount logic into initramfs for both baremetal pxe mode and vm mode. --- files/etc.mount | 26 -------------------------- files/persist.mount | 24 ------------------------ files/var.mount | 26 -------------------------- scripts/00bootup/10-mount-etc.sh | 4 ++++ 4 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 files/etc.mount delete mode 100644 files/persist.mount delete mode 100644 files/var.mount create mode 100644 scripts/00bootup/10-mount-etc.sh diff --git a/files/etc.mount b/files/etc.mount deleted file mode 100644 index 7501f78a..00000000 --- a/files/etc.mount +++ /dev/null @@ -1,26 +0,0 @@ -## Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - # KubeOS is licensed under the Mulan PSL v2. - # You can use this software according to the terms and conditions of the Mulan PSL v2. - # You may obtain a copy of Mulan PSL v2 at: - # http://license.coscl.org.cn/MulanPSL2 - # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR - # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR - # PURPOSE. -## See the Mulan PSL v2 for more details. - -[Unit] -Description=etc Dir -DefaultDependencies=no -Conflicts=umount.target -Before=local-fs.target umount.target -Wants=persist.mount -After=persist.mount - -[Mount] -What=overlay -Where=/etc -Type=overlay -Options=upperdir=/persist/etc,lowerdir=/etc,workdir=/persist/etcwork - -[Install] -WantedBy=local-fs.target diff --git a/files/persist.mount b/files/persist.mount deleted file mode 100644 index edc46d2b..00000000 --- a/files/persist.mount +++ /dev/null @@ -1,24 +0,0 @@ -## Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - # KubeOS is licensed under the Mulan PSL v2. - # You can use this software according to the terms and conditions of the Mulan PSL v2. - # You may obtain a copy of Mulan PSL v2 at: - # http://license.coscl.org.cn/MulanPSL2 - # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR - # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR - # PURPOSE. -## See the Mulan PSL v2 for more details. - -[Unit] -Description=PERSIST Dir (/persist) -DefaultDependencies=no -Conflicts=umount.target -Before=local-fs.target umount.target - -[Mount] -What=/dev/disk/by-label/PERSIST -Where=/persist -Type=ext4 -Options=defaults - -[Install] -WantedBy=local-fs.target diff --git a/files/var.mount b/files/var.mount deleted file mode 100644 index 4343207d..00000000 --- a/files/var.mount +++ /dev/null @@ -1,26 +0,0 @@ -## Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - # KubeOS is licensed under the Mulan PSL v2. - # You can use this software according to the terms and conditions of the Mulan PSL v2. - # You may obtain a copy of Mulan PSL v2 at: - # http://license.coscl.org.cn/MulanPSL2 - # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR - # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR - # PURPOSE. -## See the Mulan PSL v2 for more details. - -[Unit] -Description=var Dir -DefaultDependencies=no -Conflicts=umount.target -Before=local-fs.target umount.target -Wants=persist.mount -After=persist.mount - -[Mount] -What=/persist/var -Where=/var -Type=node -Options=bind - -[Install] -WantedBy=local-fs.target diff --git a/scripts/00bootup/10-mount-etc.sh b/scripts/00bootup/10-mount-etc.sh new file mode 100644 index 00000000..ba9f8772 --- /dev/null +++ b/scripts/00bootup/10-mount-etc.sh @@ -0,0 +1,4 @@ +mount -t xfs /dev/disk/by-label/PERSIST /sysroot/persist +mount -t overlay -o upperdir=/sysroot/persist/etc,lowerdir=/sysroot/etc,workdir=/sysroot/persist/etcwork overlay /sysroot/etc + +mount --bind /sysroot/persist/var /sysroot/var \ No newline at end of file -- Gitee