You are not logged in.
I'm trying to make a RAM-only instance of Arch by a complete chroot in an initrd.img. With the chroot 100% functional, I run this function against it ($1 being the chroot), and I get an error when booting via grub about an inconsistent filesystem structure. What am I doing wrong?
create-initrd() {
msg "Compressing chroot with cpio"
cd "$1"
cpio --verbose -H newc -o < <(find .) > ../initrd.img
cd "$OLDPWD"
msg "Compressing chroot with xz"
xz -v9 initrd.img && mv -v initrd.img.xz initrd.img
Offline
Try
cd "$1"
find . -print0 | bsdcpio -0oH newc -v | xz --check=crc32 -9 -v > ../initrd.img
cd "${OLDPWD}"
My new forum user/nick name is "the.ridikulus.rat" .
Offline
Ooooh, that actually did the trick! However, due to the initrd being fairly large, an lzma2-compressed image takes about 5 minutes to extract. I would like to have a raw cpio archive, but can't get that to work. Does this look okay?
bsdcpio -0oH newc -v < <(find . -print0) > "../$dest.img"
Offline
Why make this hard? Keep the pipeline that skodabenz gave you, just remove the second pipe.
find . -print0 | bsdcpio -0oH newc > initramfs
I'm not sure if the -v option writes to stderr or stdout, but if its writing to stdout, that would be a problem. Man page says stderr.
I've made plenty of uncompressed initramfs images that have worked without issue. mkinitcpio will create them if you specify COMPRESSION=cat
Last edited by falconindy (2011-06-22 04:13:35)
Offline