diff --git a/ChangeLog b/ChangeLog index 717b29475..ca150f11b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-04-29 Robert Millan + + From Yann Dirson : + * util/mkbimage: Misc syntax fixes. + 2004-04-29 Jeroen Dekkers * stage2/char_io.c (grub_memcmp): Define for stage1.5 too. diff --git a/util/mkbimage b/util/mkbimage index ee132d38c..52c229c04 100644 --- a/util/mkbimage +++ b/util/mkbimage @@ -178,9 +178,12 @@ mkbimage_cp () esac if [ "$offset" = 0 ] && which $cp > /dev/null ; then - $mkdir ${image}:/boot - $mkdir ${image}:/boot/grub - $cp ${image}1/boot/grub/* ${image}:/boot/grub/ + for dir in $(cd ${image}1 && find -type d) ; do + $mkdir ${image}:$dir + done + for file in $(cd ${image}1 && find -type f) ; do + $cp ${image}1/$file ${image}:$file + done elif [ "`id -u`" = "0" ] ; then losetup $lo_options /dev/loop1 $image mkdir ${image}.mnt @@ -345,7 +348,7 @@ if [ "$image_type" = "hd" ]; then EOT - offset="-o $(($sectors * $block_size))" + offset="$(($sectors * $block_size))" type_option= else offset="0" @@ -355,7 +358,8 @@ fi mkbimage_mkfs # then untar the files -mkdir ${image}1 2>/dev/null +[ ! -e ${image}1 ] || { echo "${image}1 exists, please remove it first"; exit 1;} +mkdir -p ${image}1 $decompress $tarfile | tar -C ${image}1 $debug -xf - # copy the untarred files into the filesystem image @@ -364,7 +368,7 @@ mkbimage_cp #We verify that the stage2 exists and we search the name stage2_os_name=`find ${image}1 -name stage2 -type f` -[ ! $stage2_os_name ] && { echo "I can't find stage2!"; exit 1;} +[ -r "$stage2_os_name" ] || { echo "I can't find stage2!"; exit 1;} #------------------------- GRUB stuff if [ "$image_type" = "hd" ]; then @@ -408,4 +412,6 @@ mkisofs -b -hard-disk-boot -c boot.catalog -o raw.iso Enjoy! EOF +rm -rf ${image}1 + exit 0