Live CD Kernel

From LFScript
Revision as of 10:21, 25 March 2017 by Marcel (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

With proper configuration, the kernel from LFS can now be used for Live CD's. So a separate build of the kernel is no longer required. This page is no longer maintained.

Compiles the Linux kernel with OverlayFS and SquashFS support. This script is not required if you configure your kernel to include OverlayFS and SquashFS yourself.

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