From 8a9c34bcfb59f5bb83448fe0d941964f9f3263f3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 14 Mar 2005 22:08:28 +0000 Subject: [PATCH] Added `-i ' option. If specified, the file is included (sourced) before unmounting the image. That solve my problem that mounting and copying things onto the image after makehdimage is done, damages the FS integrity for any reason (Axel can't reproduce it, of course :-). Maybe others have the same problem. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11744 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- makehdimage | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/makehdimage b/makehdimage index 88e52b4483..5967c6dfcb 100755 --- a/makehdimage +++ b/makehdimage @@ -1,6 +1,6 @@ #!/bin/sh -# Usage: makehdimage [image path/target dir] +# Usage: makehdimage [-i includeFile] [image path/target dir] # # This script will compile all files needed to create a bootable Haiku image, # create such an image, and copy the files to the correct location. @@ -12,6 +12,9 @@ # If you specify a target directory, no image is going to be created at # all. # +# If you pass `-i includeFile', the file is sourced before unmounting the +# image. +# # The image is populated using the bfs_shell which is created from the sources. # The bfs_shell emulates a mini-kernel evironment with a mounted BFS. The # program fs_shell_command is used to deliver commands to it. Due to this @@ -41,6 +44,21 @@ sourceDir=. alreadyMounted= targetDir=/haiku +includeFile= + +# check whether there's a file to be included +if [ $# \> 0 ]; then + if [ "$1" = "-i" ]; then + shift + if [ $# \> 0 ]; then + includeFile="$1" + shift + else + echo "Error: Option \`-i' requires a parameter!" + exit 1 + fi + fi +fi # disk image path, size in MB if [ -d "$1" ]; then @@ -385,6 +403,11 @@ for inSuperFile in $mimeDBSource/*.super; do done +# source the include file, if any +if [ "$includeFile" != "" ]; then + . $includeFile +fi + cd $previousDir sync