+2004-04-29 Robert Millan <robertmh@gnu.org>
+
+ From Yann Dirson <dirson@debian.org>:
+ * util/mkbimage: Misc syntax fixes.
+
2004-04-29 Jeroen Dekkers <jeroen@dekkers.cx>
* stage2/char_io.c (grub_memcmp): Define for stage1.5 too.
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
EOT
- offset="-o $(($sectors * $block_size))"
+ offset="$(($sectors * $block_size))"
type_option=
else
offset="0"
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
#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
Enjoy!
EOF
+rm -rf ${image}1
+
exit 0