You are not logged in.
Following wiki guide on mkinitcpio I can easily extract image using
lsinintcpio -x <image file>However rebuilding it seems to be far more difficult, tried to follow guide on making an edit too mkinicpio to find how to compress image). Both the wiki guide and the method of finding how to compress image failed.
It is a stock initramfs that I just wanted to take a peek at and try to rebuild it.
What am I doing wrong?
find . -mindepth 1 -printf '%P\0' | sort -z | LANG=C bsdtar --null -cnf - -T - | gzip > <image>Failed....
EDIT added files I needed via FILES in mkinitcpio.conf, builds as normal
mkinitcpio -c mkinitcpio-custom.conf -g archiso.imgLast edited by Mr Green (2019-11-03 14:46:45)
Mr Green
Offline
You are creating a zipped tar file with that pipeline, not a cpio archive. Compression is optional, but I don't beleive cpio is. Replace the bsdtar command with cpio.
EDIT: after some searching this may be irrelevant. It looks like tar and cpio (with appropriate flags) should likely have equivalent output. But I've never used bsdtar for making an initramfs.
When you say you command "failed", what does this mean? Did the pipeline fail? If so, what was the error output? Or did the image not boot properly? If so, where/when/how did it go wrong?
Last edited by Trilby (2019-11-02 18:19:50)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Mod note: You've posted this topic in System Administration, which is locked to new posts by non-privileged users. Moving to Apps and DEs.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Online
When you use above code (which is what I got from mkinitcpio as per wiki) image is
[ ~ ] ls -lah archiso.img
-rw-r--r-- 1 mrgreen users 86M Nov 3 07:49 archiso.imgFrom normal mkinitcpio ....
-rw-r--r-- 1 root root 49M Nov 2 17:53 archiso.imgAnd yes I made sure not to build image in the working directory ;-)
Mr Green
Offline
When you say you command "failed", what does this mean?
So when you say if "failed" you mean it succeeded?
It has different ownership as you apparently ran the pipeline as your user. (or, unlike mkinitcpio, you didn't run the second round of bsdtar setting uid/giid).
It has different size, likely because of different compression options.
But are either of these what you are actually asking about?
Last edited by Trilby (2019-11-03 13:01:32)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Decide to use FILES in mkinitcpio.conf, seemed a less complicated way to do it. Maybe as you say the piped command was not correct. Once I figure out BINARIES then maybe I can get it working.
Basically I was trying to test networking from initramfs, adding net was easy but you need the helper script for busybox to get a wired connection.
Will mark as solved as I have kind of got what I wanted.
Thanks for your help ;-)
Mr Green
Offline