#651 Issue closed: Additional files to initramfs

v1p3r0u5 opened issue at 2015-09-11 08:03:

Hi together,

not sure, if it's an issue or if it works as designed..

For me the ISO_FILES() array is a little bit useless, because this additional files will not be added to the initramfs and because of this they are not automatically available on restore time. Especially if you need a file like inclexcl for TSM (which otherwise will generate an error while trying to restore) you can not use the auto-restore-function...

I would prefer either that this files will be copied to initramfs before you create the initrd image or an additional array with a new script managing the described behaviour. For my environment I created a workaround.
Maybe this could help for an implementation:

# cat /usr/share/rear/conf/default.conf
  ...
  # which files to include in initramfs
  ROOTFS_INCL=()
  ...

# cat /etc/rear/site.conf
  ...
  # which files to include in initramfs
  ROOTFS_INCL=(/etc/tsm.inclexcl /etc/file1 /etc/dir/*)
  ...

# cat /usr/share/rear/build/default/49_include_files.sh
  if test "${#ROOTFS_INCL[@]}" -gt 0 ; then

        for i in "${ROOTFS_INCL[@]}"
        do
                DEST_DIR=$ROOTFS_DIR/$(dirname $i)
                mkdir -p $DEST_DIR
                cp -pLr $i $DEST_DIR/. >&2
        done

  fi

Thanks for your effort.

Cheers, Ralf

schlomo commented at 2015-09-11 08:40:

Why not simply use the COPY_AS_IS array for this purpose?

v1p3r0u5 commented at 2015-09-11 11:06:

The answer is easy: because I did not realize that this array can be used for this purpose (the tar in the comment section was confusing me).
Sorry for this and many thanks for the hint. Works perfectly with COPY_AS_IS

schlomo commented at 2015-09-11 11:37:

Pull requests for documentation are always welcome :-)


[Export of Github issue for rear/rear.]