mardi 14 avril 2015

[System] Patching an initramfs


Extract the cpio filesystem in a directory, create or modify files, recreate a new cpio archive.

CPIO_FILE="rootfs.cpio"
CPIO_DIR="/tmp/yourCpioDir"
#Extract the cpio archive in the CPIO_DIR
mkdir $CPIO_DIR
pushd $CPIO_DIR
fakeroot cpio -i < $CPIO_FILE
#Apply your changes
#Recreate the cpio archive
find . | cpio --create --format='newc' > $CPIO_FILE 

Aucun commentaire:

Enregistrer un commentaire