General TC > General TC Talk

[Solved] how to remaster cat'ed initramfs?

<< < (3/3)

Rich:
Hi GNUser

--- Quote from: GNUser on January 10, 2026, 07:21:13 AM --- ... Is there a way to avoid an infinite loop?
--- End quote ---
Yes. Switch to the GNU versions of zcat and/or cpio. It will then
spit out a bunch of warnings which can be silenced like this:

--- Code: ---zcat ../initrd.gz | while sudo cpio -W none -id; do :; done
--- End code ---

GNUser:
Hi Rich. That's just beautiful! I'm in your debt, as usual.
Happy hacking!

GNUser:

--- Quote from: Rich on January 10, 2026, 08:49:54 AM ---
--- Quote from: GNUser on January 10, 2026, 07:21:13 AM --- ... Is there a way to avoid an infinite loop?
--- End quote ---
Yes. Switch to the GNU versions of zcat and/or cpio.

--- End quote ---
At the risk of stating the obvious:
Another way to avoid an infinite loop, while sticking to the default (busybox) versions of zcat and cpio, is to exit the loop after a certain number of iterations:


--- Code: ---i=0
zcat ../initrd.gz | while [ $i -lt 10 ]; do sudo cpio -id; i=$((i+1)); done

--- End code ---

The above assumes the user's  initrd.gz  was built by concatenating no more than 10 initramfs'es together, which seems like a reasonable assumption.

I think we can confidently mark the thread as Solved :)

Rich:
Hi GNUser

--- Quote from: GNUser on January 13, 2026, 10:11:36 AM --- ... I think we can confidently mark the thread as Solved :)
--- End quote ---
So marked.  ;D

Navigation

[0] Message Index

[*] Previous page

Go to full version