diff --git a/README.md b/README.md index 1eb3c3982..17e3ac140 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,10 @@ Ramdisk elements support the following files in their element directories: * init.d : POSIX shell script fragments that will be appended to the default script executed as the ramdisk is booted (/init). +* ramdisk-install.d : called to copy files into the ramdisk. The variable + TMP\_MOUNT\_PATH points to the root of the tree that will be packed into + the ramdisk. + * udev.d : udev rules files that will be copied into the ramdisk. ### Element coding standard ### diff --git a/elements/ramdisk/post-install.d/99-build-ramdisk b/elements/ramdisk/post-install.d/99-build-ramdisk index 61a373791..9826fbe69 100755 --- a/elements/ramdisk/post-install.d/99-build-ramdisk +++ b/elements/ramdisk/post-install.d/99-build-ramdisk @@ -26,15 +26,17 @@ IMAGE_ELEMENT= mk_build_dir mkdir -p $TMP_BUILD_DIR/mnt -TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt +export TMP_HOOKS_PATH=/tmp +export TMP_MOUNT_PATH=$TMP_BUILD_DIR/mnt -echo "working in $TMP_MOUNT_PATH" +echo "building ramdisk in $TMP_MOUNT_PATH" create_ramdisk_base populate_lib populate_busybox populate_init populate_udev +SCRIPT_HOME=/tmp/in_target.d/bin TMP_HOOKS_PATH=/tmp/in_target.d run_d ramdisk-install finalise_image save_image /tmp/ramdisk cp /boot/vmlinuz-${KERNEL_VERSION} /tmp/kernel diff --git a/lib/common-functions b/lib/common-functions index ab4801d0d..f00ae0777 100644 --- a/lib/common-functions +++ b/lib/common-functions @@ -192,7 +192,7 @@ function cleanup_dirs () { rm -rf $TMP_BUILD_DIR $TMP_IMAGE_DIR } -# Run a directory of hooks outside the target. +# Run a directory of hooks outside the target (that is, no chrooting). function run_d() { check_element check_break before-$1 bash