-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
erofs is an alternative readonly filesystem that can be used as alternative to squashfs. This Fixes #2633
- Loading branch information
Showing
14 changed files
with
228 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<image schemaversion="7.5" name="kiwi-test-image-erofs"> | ||
<description type="system"> | ||
<author>Marcus Schaefer</author> | ||
<contact>[email protected]</contact> | ||
<specification>Fedora Appliance, Testing erofs filesystem image</specification> | ||
</description> | ||
<preferences> | ||
<version>2.0.0</version> | ||
<packagemanager>dnf5</packagemanager> | ||
<rpm-check-signatures>false</rpm-check-signatures> | ||
</preferences> | ||
<preferences> | ||
<type image="erofs"/> | ||
</preferences> | ||
<users> | ||
<user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root" groups="root"/> | ||
</users> | ||
<repository type="rpm-md" alias="kiwi-next-generation" priority="1"> | ||
<source path="obs://Virtualization:Appliances:Staging/Fedora_Rawhide"/> | ||
</repository> | ||
<repository type="rpm-md" alias="Fedora_Rawhide"> | ||
<source path="obs://Fedora:Rawhide/standard"/> | ||
</repository> | ||
<packages type="image"> | ||
<package name="kernel"/> | ||
<package name="selinux-policy-targeted"/> | ||
<package name="dhclient"/> | ||
<package name="glibc-all-langpacks"/> | ||
<package name="vim"/> | ||
<package name="tzdata"/> | ||
<package name="NetworkManager"/> | ||
</packages> | ||
<packages type="bootstrap"> | ||
<package name="filesystem"/> | ||
<package name="basesystem"/> | ||
<package name="fedora-release"/> | ||
</packages> | ||
</image> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,26 @@ | ||
#!/bin/bash | ||
#================ | ||
# FILE : config.sh | ||
#---------------- | ||
# PROJECT : OpenSuSE KIWI Image System | ||
# COPYRIGHT : (c) 2006 SUSE LINUX Products GmbH. All rights reserved | ||
# : | ||
# AUTHOR : Marcus Schaefer <[email protected]> | ||
# : | ||
# BELONGS TO : Operating System images | ||
# : | ||
# DESCRIPTION : configuration script for SUSE based | ||
# : operating systems | ||
#---------------- | ||
#====================================== | ||
# Functions... | ||
#-------------------------------------- | ||
test -f /.kconfig && . /.kconfig | ||
test -f /.profile && . /.profile | ||
|
||
set -ex | ||
|
||
declare kiwi_profiles=${kiwi_profiles} | ||
declare kiwi_iname=${kiwi_iname} | ||
|
||
#====================================== | ||
# Greeting... | ||
#-------------------------------------- | ||
echo "Configure image: [$kiwi_iname]..." | ||
|
||
#====================================== | ||
# Setup baseproduct link | ||
#-------------------------------------- | ||
suseSetupProduct | ||
|
||
#====================================== | ||
# Activate services | ||
#-------------------------------------- | ||
suseInsertService sshd | ||
systemctl enable sshd | ||
|
||
#====================================== | ||
# Setup default target, multi-user | ||
# Include erofs module | ||
#-------------------------------------- | ||
baseSetRunlevel 3 | ||
for profile in ${kiwi_profiles//,/ }; do | ||
if [ "${profile}" = "EroFS" ]; then | ||
# remove from blacklist | ||
rm -f /usr/lib/modprobe.d/60-blacklist_fs-erofs.conf | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright (c) 2024 SUSE Software Solutions Germany GmbH. All rights reserved. | ||
# | ||
# This file is part of kiwi. | ||
# | ||
# kiwi is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# kiwi is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with kiwi. If not, see <http://www.gnu.org/licenses/> | ||
# | ||
from typing import List | ||
|
||
# project | ||
from kiwi.filesystem.base import FileSystemBase | ||
from kiwi.command import Command | ||
|
||
|
||
class FileSystemEroFs(FileSystemBase): | ||
""" | ||
**Implements creation of erofs filesystem** | ||
""" | ||
def create_on_file( | ||
self, filename, label: str = None, exclude: List[str] = None | ||
): | ||
""" | ||
Create erofs filesystem from data tree | ||
:param string filename: result file path name | ||
:param string label: volume label | ||
:param list exclude: list of exclude dirs/files | ||
""" | ||
self.filename = filename | ||
exclude_options = [] | ||
compression = self.custom_args.get('compression') | ||
if compression: | ||
self.custom_args['create_options'].append('-z') | ||
self.custom_args['create_options'].append(compression) | ||
|
||
if exclude: | ||
for item in exclude: | ||
exclude_options.append(f'--exclude-regex={item}') | ||
|
||
if label: | ||
self.custom_args['create_options'].append('-L') | ||
self.custom_args['create_options'].append(label) | ||
|
||
Command.run( | ||
[ | ||
'mkfs.erofs' | ||
] + self.custom_args['create_options'] + exclude_options + [ | ||
self.filename, self.root_dir | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.