reformat mkfs parts

This commit is contained in:
Tobias Powalowski 2024-02-09 08:24:35 +01:00
parent 39bd724d07
commit e3b0371d1f
3 changed files with 18 additions and 17 deletions

View file

@ -121,8 +121,17 @@ _run_mkfs() {
_LABEL_NAME=$(echo "${line}" | cut -d '|' -f 5)
_FS_OPTIONS=$(echo "${line}" | cut -d '|' -f 6)
[[ "${_FS_OPTIONS}" == "NONE" ]] && _FS_OPTIONS=""
# bcachefs and btrfs parameters
if [[ ${_FSTYPE} == "btrfs" ]]; then
# bcachefs, btrfs and other parameters
if [[ ${_FSTYPE} == "bcachefs" ]]; then
_BCACHEFS_COMPRESS=$(echo "${line}" | cut -d '|' -f 7)
if [[ "${_BCACHEFS_COMPRESS}" == "NONE" ]];then
_BCACHEFS_COMPRESS=""
else
_BCACHEFS_COMPRESS="--compression=${_BCACHEFS_COMPRESS}"
fi
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" \
"${_BCACHEFS_COMPRESS}" || return 1
elif [[ ${_FSTYPE} == "btrfs" ]]; then
_BTRFS_DEVS=$(echo "${line}" | cut -d '|' -f 7)
# remove # from array
_BTRFS_DEVS="${_BTRFS_DEVS//#/\ }"
@ -134,15 +143,6 @@ _run_mkfs() {
[[ "${_BTRFS_COMPRESS}" == "NONE" ]] && _BTRFS_COMPRESS=""
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" \
"${_BTRFS_DEVS}" "${_BTRFS_LEVEL}" "${_BTRFS_SUBVOLUME}" "${_BTRFS_COMPRESS}" || return 1
elif [[ ${_FSTYPE} == "bcachefs" ]]; then
_BCACHEFS_COMPRESS=$(echo "${line}" | cut -d '|' -f 7)
if [[ "${_BCACHEFS_COMPRESS}" == "NONE" ]];then
_BCACHEFS_COMPRESS=""
else
_BCACHEFS_COMPRESS="--compression=${_BCACHEFS_COMPRESS}"
fi
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" \
"${_BCACHEFS_COMPRESS}" || return 1
else
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" || return 1
fi

View file

@ -86,17 +86,18 @@ _auto_create_filesystems() {
_BTRFS_LEVEL=""
_BTRFS_SUBVOLUME=""
_BTRFS_COMPRESS=""
if [[ "${_FSTYPE}" == "btrfs" ]]; then
# bcachefs, btrfs and other parameters
if [[ "${_FSTYPE}" == "bcachefs" ]]; then
_BCACHEFS_COMPRESS="--compression=zstd"
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" \
"${_BCACHEFS_COMPRESS}" || return 1
elif [[ "${_FSTYPE}" == "btrfs" ]]; then
_BTRFS_DEVS="${_DEV}"
[[ "${_MP}" == "/" ]] && _BTRFS_SUBVOLUME="root"
[[ "${_MP}" == "/home" ]] && _BTRFS_SUBVOLUME="home"
_BTRFS_COMPRESS="compress=zstd"
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" \
"${_BTRFS_DEVS}" "${_BTRFS_LEVEL}" "${_BTRFS_SUBVOLUME}" "${_BTRFS_COMPRESS}" || return 1
elif [[ "${_FSTYPE}" == "bcachefs" ]]; then
_BCACHEFS_COMPRESS="--compression=zstd"
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" \
"${_BCACHEFS_COMPRESS}" || return 1
else
_mkfs "${_DEV}" "${_FSTYPE}" "${_DESTDIR}" "${_DOMKFS}" "${_MP}" "${_LABEL_NAME}" "${_FS_OPTIONS}" || return 1
fi

View file

@ -550,7 +550,7 @@
<li><a href="https://wiki.archlinux.org/title/Persistent_block_device_naming" title="Persistent block device naming"><strong>Persistent block device naming</strong></a> support: <a href="https://wiki.archlinux.org/title/PARTUUID" title="PARTUUID"><strong>PARTUUID</strong></a>, <a href="https://wiki.archlinux.org/title/PARTLABEL" title="PARTLABEL"><strong>PARTLABEL</strong></a>, UUID, LABEL and KERNEL</li>
<li>Creation of software <a href="https://wiki.archlinux.org/title/RAID" title="RAID"><strong>RAID</strong></a>/<a href="https://wiki.archlinux.org/title/RAID" title="RAID"><strong>RAID</strong></a> partitions, <a href="https://wiki.archlinux.org/title/LVM" title="LVM"><strong>LVM</strong></a> devices and <a href="https://wiki.archlinux.org/title/LUKS" title="LUKS"><strong>LUKS</strong></a> encrypted devices</li>
<li>Supports standard linux, <a href="https://wiki.archlinux.org/title/RAID" title="RAID"><strong>RAID</strong></a>/<a href="https://wiki.archlinux.org/title/RAID" title="RAID"><strong>RAID</strong></a>_partitions, dmraid/<a href="https://wiki.archlinux.org/title/Fakeraid" title="Fakeraid"><strong>fakeraid</strong></a>, <a href="https://wiki.archlinux.org/title/LVM" title="LVM"><strong>LVM</strong></a> and <a href="https://wiki.archlinux.org/title/LUKS" title="LUKS"><strong>LUKS</strong></a> encrypted devices</li>
<li>Filesystem support: <a href="https://wiki.archlinux.org/title/Bcachefs" title="BCACHEFS"><strong>BCACHEFS</strong></a>, <a href="https://wiki.archlinux.org/title/Btrfs" title="BTRFS"><strong>BTRFS</strong></a>, EXT2/<a href="https://wiki.archlinux.org/title/Ext4" title="EXT4"><strong>4</strong></a>, <a href="https://wiki.archlinux.org/title/XFS" title="XFS"><strong>XFS</strong></a>, <a href="https://wiki.archlinux.org/title/VFAT" title="VFAT"><strong>VFAT</strong></a></li>
<li>Filesystem support: <a href="https://wiki.archlinux.org/title/Bcachefs" title="BCACHEFS"><strong>BCACHEFS</strong></a>, <a href="https://wiki.archlinux.org/title/Btrfs" title="BTRFS"><strong>BTRFS</strong></a>, <a href="https://wiki.archlinux.org/title/Ext4" title="EXT4"><strong>Ext2/4</strong></a>, <a href="https://wiki.archlinux.org/title/XFS" title="XFS"><strong>XFS</strong></a>, <a href="https://wiki.archlinux.org/title/VFAT" title="VFAT"><strong>VFAT</strong></a></li>
</ul>
<h4 data-number="3.6.2" id="install-packages"><span class="header-section-number">3.6.2</span> <strong>Install Packages</strong></h4>
<ul>