Ramroot
ramroot for gentoo via initramfs
Install / Use
/learn @zhjie/RamrootREADME
ramroot for gentoo via initramfs
- READ and CHANGE ramdisk.sh and gen_initramfs-ARCH.sh before deploying. This is just a script I made for myself, not a fully developed software.
- ramdisk-TYPE.sh prepares root_fs. gen_initramfs-ARCH.sh packages new initramfs.img with the new init file.
- MUST configure exclusions properly in _mount_dir@ramdisk, and make sure /mnt/.ramdisk is less than half your memory size. Make sure layouts of / and /mnt/.ramdisk/ are the same, e.g. merged-usr or not.
rsync -a /$1/ /mnt/.ramdisk/$1 --exclude src --exclude cache --exclude db --exclude portage --exclude python --exclude llvm --exclude repos --exclude binpkgs --exclude distfiles
- /etc/genkernel.conf is with SYMLINK="yes". /usr/share/genkernel/gen_funcs.sh is for vfat boot.
- Kernel is compiled by genkernel with "Support initial ramdisk/ramfs compressed using XZ".
- The init file is modified from /usr/share/genkernel/defaults/linuxrc. It simply creates a tmpfs-based /ram_chroot synced from /mnt/.ramdisk/, and umount real_root before booting the real init via switch_root.
mkdir /ram_chroot
mount -t tmpfs -o rw,noatime none /ram_chroot
cp -a "${CHROOT}"/mnt/.ramdisk/* /ram_chroot/
mount --move /proc /ram_chroot/proc
mount --move /sys /ram_chroot/sys
mount --move /dev /ram_chroot/dev
umount ${CHROOT}
good_msg "Switching to real root: switch_root /ram_chroot ${init} ${init_opts}"
exec switch_root /ram_chroot "${init}"
- gen_initramfs-ARCH.sh syncs kernel files from the server, packages the initramfs.img with new init, and deploys to /boot.
- config.txt is for raspberry pi.
kernel kernel
initramfs initramfs followkernel
- The script is for Gentoo. But it should work for Archlinux, if you re-generate init from /usr/lib/initcpio/init and package initramfs with zst.
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
