Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/dracut/modules..../99squash
File: module-setup.sh
#!/bin/bash
[0] Fix | Delete
[1] Fix | Delete
check() {
[2] Fix | Delete
require_binaries mksquashfs unsquashfs || return 1
[3] Fix | Delete
[4] Fix | Delete
for i in CONFIG_SQUASHFS CONFIG_BLK_DEV_LOOP CONFIG_OVERLAY_FS ; do
[5] Fix | Delete
if ! check_kernel_config $i; then
[6] Fix | Delete
dinfo "dracut-squash module requires kernel configuration $i (y or m)"
[7] Fix | Delete
return 1
[8] Fix | Delete
fi
[9] Fix | Delete
done
[10] Fix | Delete
[11] Fix | Delete
return 255
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
depends() {
[15] Fix | Delete
echo "systemd-initrd"
[16] Fix | Delete
return 0
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
installpost() {
[20] Fix | Delete
local _busybox
[21] Fix | Delete
_busybox=$(find_binary busybox)
[22] Fix | Delete
[23] Fix | Delete
# Move everything under $initdir except $squash_dir
[24] Fix | Delete
# itself into squash image
[25] Fix | Delete
for i in "$initdir"/*; do
[26] Fix | Delete
[[ "$squash_dir" == "$i"/* ]] || mv "$i" "$squash_dir"/
[27] Fix | Delete
done
[28] Fix | Delete
[29] Fix | Delete
# Create mount points for squash loader
[30] Fix | Delete
mkdir -p "$initdir"/squash/
[31] Fix | Delete
mkdir -p "$squash_dir"/squash/
[32] Fix | Delete
[33] Fix | Delete
# Copy dracut spec files out side of the squash image
[34] Fix | Delete
# so dracut rebuild and lsinitrd can work
[35] Fix | Delete
mkdir -p "$initdir/usr/lib/dracut/"
[36] Fix | Delete
for file in "$squash_dir"/usr/lib/dracut/*; do
[37] Fix | Delete
[[ -f $file ]] || continue
[38] Fix | Delete
cp "$file" "$initdir/${file#$squash_dir}"
[39] Fix | Delete
done
[40] Fix | Delete
[41] Fix | Delete
# Install required modules and binaries for the squash image init script.
[42] Fix | Delete
if [[ $_busybox ]]; then
[43] Fix | Delete
inst "$_busybox" /usr/bin/busybox
[44] Fix | Delete
for _i in sh echo mount modprobe mkdir switch_root grep umount; do
[45] Fix | Delete
ln_r /usr/bin/busybox /usr/bin/$_i
[46] Fix | Delete
done
[47] Fix | Delete
else
[48] Fix | Delete
DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount
[49] Fix | Delete
[50] Fix | Delete
# libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
[51] Fix | Delete
inst_libdir_file -o "libgcc_s.so*"
[52] Fix | Delete
[53] Fix | Delete
# FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled
[54] Fix | Delete
[[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*"
[55] Fix | Delete
fi
[56] Fix | Delete
[57] Fix | Delete
hostonly="" instmods "loop" "squashfs" "overlay"
[58] Fix | Delete
dracut_kernel_post
[59] Fix | Delete
[60] Fix | Delete
# Install squash image init script.
[61] Fix | Delete
ln_r /usr/bin /bin
[62] Fix | Delete
ln_r /usr/sbin /sbin
[63] Fix | Delete
inst_simple "$moddir"/init-squash.sh /init
[64] Fix | Delete
[65] Fix | Delete
# make sure that library links are correct and up to date for squash loader
[66] Fix | Delete
build_ld_cache
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
install() {
[70] Fix | Delete
if [[ $DRACUT_SQUASH_POST_INST ]]; then
[71] Fix | Delete
installpost
[72] Fix | Delete
fi
[73] Fix | Delete
}
[74] Fix | Delete
[75] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function