mount with compression flags during install instead of compressing later
This commit is contained in:
parent
fed2cb9ebc
commit
2124c5ca82
2 changed files with 7 additions and 11 deletions
|
@ -216,7 +216,7 @@ fs_progs_pkg() {
|
|||
# Binds the directory $1 at the mountpoint $2 and sets propagation to private.
|
||||
mount_bind() {
|
||||
mkdir -p "$2"
|
||||
mount --bind "$1" "$2"
|
||||
mount -o noatime$COMPRESSFLAGS --bind "$1" "$2"
|
||||
mount --make-private "$2"
|
||||
}
|
||||
|
||||
|
@ -361,6 +361,12 @@ done
|
|||
|
||||
export ROOTFS
|
||||
|
||||
COMPRESSFLAGS=
|
||||
if [ "$ROOTFS" = 'btrfs' ]; then
|
||||
COMPRESSFLAGS=',compress=zstd'
|
||||
fi
|
||||
export COMPRESSFLAGS
|
||||
|
||||
case "$ALPINE_BRANCH" in
|
||||
[0-9]*) ALPINE_BRANCH="v$ALPINE_BRANCH";;
|
||||
esac
|
||||
|
@ -481,12 +487,6 @@ fi
|
|||
#-----------------------------------------------------------------------
|
||||
einfo 'Setting up extlinux bootloader'
|
||||
|
||||
COMPRESSFLAGS=
|
||||
if [ "$ROOTFS" = 'btrfs' ]; then
|
||||
COMPRESSFLAGS=',compress=zstd'
|
||||
fi
|
||||
export COMPRESSFLAGS
|
||||
|
||||
_apk add --root . --no-scripts syslinux
|
||||
setup_extlinux . "UUID=$root_uuid" "$ROOTFS" "$KERNEL_FLAVOR" "$SERIAL_PORT"
|
||||
|
||||
|
|
|
@ -46,9 +46,5 @@ step 'Creating authorized_keys for root'
|
|||
mkdir -p /root/.ssh/
|
||||
echo "$SSHPUBKEY" >> /root/.ssh/authorized_keys
|
||||
|
||||
if [ "$ROOTFS" = 'btrfs' ]; then
|
||||
step 'Compressing btrfs'
|
||||
btrfs filesystem defragment -r -czstd /
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue