Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use initoverlayfs as an init system #77

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions bin/initoverlayfs-install
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,19 @@ extract_initrd_into_initoverlayfs() {
# main()

args="$*"
initoverlayfs_init="false"
while [[ $# -gt 0 ]]; do
echo "$1"
case $1 in
--kver)
kver="$2"
shift 2
;;
--initoverlayfs-init)
initoverlayfs_init="true"
args=$(echo "$args" | sed "s/--initoverlayfs-init//g")
shift 1
;;
*)
shift 1
;;
Expand All @@ -149,11 +155,16 @@ detect_path_initramfs
if ! [ -e "$INITOVERLAYFS_CONF" ] || ! grep -q '[^[:space:]]' "$INITOVERLAYFS_CONF"; then
boot_partition=$(< /etc/fstab grep "${INITRAMFS_DIR}.*ext4" | awk '{print $1}')

printf "%s\n%s\n%s\n%s\n" \
printf "%s\n%s\n%s\n%s" \
"bootfs $boot_partition" \
"bootfstype ext4" \
"initoverlayfs_builder dracut -M -o \"initoverlayfs fcoe\"" \
"initrd_builder dracut -M -m \"kernel-modules udev-rules initoverlayfs systemd base\" -o \"bash systemd-initrd i18n kernel-modules-extra rootfs-block dracut-systemd usrmount fs-lib microcode_ctl-fw_dir_override shutdown nss-softokn\"" > $INITOVERLAYFS_CONF
"initoverlayfs_builder dracut -M -o \"initoverlayfs fcoe\"" > $INITOVERLAYFS_CONF

if $initoverlayfs_init; then
printf "%s\n" "initrd_builder dracut -M -m \"initoverlayfs\" -o \"kernel-modules udev-rules systemd base bash systemd-initrd i18n kernel-modules-extra rootfs-block dracut-systemd usrmount fs-lib microcode_ctl-fw_dir_override shutdown nss-softokn\"" >> $INITOVERLAYFS_CONF
else
printf "%s\n" "initrd_builder dracut -M -m \"kernel-modules udev-rules initoverlayfs systemd base\" -o \"bash systemd-initrd i18n kernel-modules-extra rootfs-block dracut-systemd usrmount fs-lib microcode_ctl-fw_dir_override shutdown nss-softokn\"" >> $INITOVERLAYFS_CONF
fi

erofs_compression_supported="true"
# shellcheck disable=SC2034
Expand All @@ -167,6 +178,10 @@ if ! [ -e "$INITOVERLAYFS_CONF" ] || ! grep -q '[^[:space:]]' "$INITOVERLAYFS_CO
fi
done

if $initoverlayfs_init; then
printf "%s\n" "initoverlayfs_init true" >> $INITOVERLAYFS_CONF
fi

if $erofs_compression_supported; then
printf "%s\n" "erofs_compression -zlz4hc,11" >> $INITOVERLAYFS_CONF
fi
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

# Current version of initoverlayfs
VERSION=0.992
VERSION=0.993
# Specify if build is a official release or a snapshot build
IS_RELEASE=false
# Used for official releases. Increment if necessary
Expand Down
Loading
Loading