Live CD Kernel

From LFScript
Revision as of 19:17, 26 February 2017 by Marcel (talk | contribs)

Compiles the Linux kernel with UnionFS and OverlayFS support.

LFScript can find this software under the name kernel-live.

Sources


MD5 Checksums:

de43a1a9e3a1ad97467c9a413bcdf896  linux-4.9.9.tar.xz

Installation

# Ensure OverlayFS is selected in the kernel configuration
if [ "$(cat .config | grep '# CONFIG_OVERLAY_FS is not set')" ]; then
    sed -i "s@# CONFIG_OVERLAY_FS is not set@@g" .config
    echo "CONFIG_OVERLAY_FS=y" >> .config
fi
# Ensure SquashFS is selected in the kernel configuration
if [ "$(cat .config | grep '# CONFIG_SQUASHFS is not set')" ]; then
    sed -i "s@# CONFIG_SQUASHFS is not set@@g" .config

    echo "CONFIG_SQUASHFS=y"                                >> .config
    echo "CONFIG_SQUASHFS_FILE_CACHE=y"                     >> .config
    echo "# CONFIG_SQUASHFS_FILE_DIRECT is not set"         >> .config
    echo "CONFIG_SQUASHFS_DECOMP_SINGLE=y"                  >> .config
    echo "# CONFIG_SQUASHFS_DECOMP_MULTI is not set"        >> .config
    echo "# CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU is not set" >> .config
    echo "# CONFIG_SQUASHFS_XATTR is not set"               >> .config
    echo "CONFIG_SQUASHFS_ZLIB=y"                           >> .config
    echo "CONFIG_SQUASHFS_LZ4=y"                            >> .config
    echo "CONFIG_SQUASHFS_LZO=y"                            >> .config
    echo "CONFIG_SQUASHFS_XZ=y"                             >> .config
    echo "# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set"      >> .config
    echo "# CONFIG_SQUASHFS_EMBEDDED is not set"            >> .config
    echo "CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3"            >> .config
fi
# Compile
make

As the root user:

# Install
cp -v arch/x86/boot/bzImage /boot/vmlinuz-4.9.9-live
cp -v .config /boot/config-4.9.9-live