# --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: target/share/initrd.in # Copyright (C) 2006 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- # extend_initrd initrd-filename from-dir # adds additional content to an existing initrd (cpio image) extend_initrd() { local initrd=$1 local from=$2 echo "Extending initrd archive ..." echo "Initrd: $initrd" echo " from: $from" ( # extract archive rm -rf $initrd.dir ; mkdir $initrd.dir cd $initrd.dir gunzip -c < $initrd | cpio -i # copy extensions cd $from cp -a . $initrd.dir # create archive cd $initrd.dir find * | cpio -o -H newc --file $initrd.cpio gzip -c -9 $initrd.cpio > $initrd ) # cleanup rm $initrd.cpio rm -rf $initrd.dir }