v0.4 - Now with README!
parent
5f2e7203af
commit
faaf03e081
|
@ -0,0 +1,32 @@
|
|||
1) What is it?
|
||||
A simple initramfs that looks for a filesystem with a given UUID (not the gpt
|
||||
PARTUUID), looks there for a .tar.xz file containing a root filesystem and
|
||||
tries to switch root filesystem to a tmpfs where the tarball was extracted.
|
||||
|
||||
2) How to use it?
|
||||
2.1) Stea^WAcquire statically linked copies of:
|
||||
a) busybox (http://www.busybox.net/)
|
||||
b) pv (http://www.ivarch.com/programs/pv.shtml)
|
||||
(protip: use magnets for faster acquiring)
|
||||
and put the binaries in the initramfs root directory (hint: ./initramfs)
|
||||
|
||||
2.2) Get UUID of your filesystem where you have an xz-compressed tarball of
|
||||
your filesystem.
|
||||
ls -l /dev/disk/by-uuid/ might help
|
||||
|
||||
2.3) Set these kernel parameters:
|
||||
rootfs_location_uuid - uuid of the filesystem containing rootfs tarball
|
||||
rootfs_filename - tarball filename
|
||||
rootfs_size - size of the tmpfs that will be used as /
|
||||
|
||||
2.4) ???
|
||||
(you might want to pray to flying spaghetti monster, or some other imaginary
|
||||
friend of your choice)
|
||||
|
||||
2.5) PROFIT!
|
||||
(assuming your system didn't OOM in the process)
|
||||
|
||||
3) I've got an idea/suggestion/bugfix!
|
||||
Patches welcome:
|
||||
git format-patch --stdout -M -C -C -1
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
die() {
|
||||
echo "${2}"
|
||||
echo "Usage: ${0} <path to directory> <output file>"
|
||||
exit $1
|
||||
}
|
||||
|
||||
[[ $# -eq 2 ]] || die 22 "Invalid number of arguments"
|
||||
[[ -d "${1}" ]] || die 20 "${1} is not a directory"
|
||||
[[ -e "${2}" ]] && die 17 "${2} exists"
|
||||
|
||||
[[ -f "${1}/pv" ]] || die 2 "${1}/pv does not exist. Read README!"
|
||||
[[ -f "${1}/busybox" ]] || die 2 "${1}/busybox does not exist. Read README!"
|
||||
|
||||
file=$(readlink -f ${2})
|
||||
|
||||
cd "${1}"
|
||||
find . -print0 | cpio --null -ov --format=newc | gzip -9 > "${file}"
|
||||
|
Loading…
Reference in New Issue