mkbimage revision 1
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg# MaKe a Bootable IMAGE --- 1.44, 2.88 and El Torito no-emulation mode
6736c640e65e06990ef33af71ee81fac4df4ff5fjim# C) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>
7025945569c7fbb49f2e64e0d26f861d22a54675jorton# C) 2001,2002,2003 Robert Millan <robertmh@gnu.org>
7025945569c7fbb49f2e64e0d26f861d22a54675jorton# This program is free software; you can redistribute it and/or modify
e20c6ecbd465cd7dabb44acea6afafc7925f3a03sf# it under the terms of the GNU General Public License as published by
12b987b969f03ef98d9175a53d849ab62f5684fecovener# the Free Software Foundation; either version 2, or (at your option)
12b987b969f03ef98d9175a53d849ab62f5684fecovener# any later version.
4c21a9f062e187b87c9cec726023f0fc086008f2sf# This program is distributed in the hope that it will be useful,
4c21a9f062e187b87c9cec726023f0fc086008f2sf# but WITHOUT ANY WARRANTY; without even the implied warranty of
4c21a9f062e187b87c9cec726023f0fc086008f2sf# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e20c6ecbd465cd7dabb44acea6afafc7925f3a03sf# GNU General Public License for more details.
7025945569c7fbb49f2e64e0d26f861d22a54675jorton# You should have received a copy of the GNU General Public License
f5b3f41700a107b9df2b3c5a1cc3e5ea775fd8fesf# along with this program; if not, you can either send email to this
f5b3f41700a107b9df2b3c5a1cc3e5ea775fd8fesf# program's maintainer or write to: The Free Software Foundation,
f5b3f41700a107b9df2b3c5a1cc3e5ea775fd8fesf# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
ec7851f543720a66e94295707116b4bc91961030sf# $Id: mkbimage,v 1.19 2004/07/21 14:43:04 robertmh Exp $
ef056d09d39412b9f7d9b71f48ff3d00222833f6humbedooh# Global variables
a9383516f09ba627694a14d533f55628426f5418jorton# You can set GRUB_PATH if you need to use a specially located GRUB.
099c357f282d4aebf2b32264f7dce6ffc0497c37sf# This MUST end by a '/'!
099c357f282d4aebf2b32264f7dce6ffc0497c37sf#----------------------------DON'T CHANGE: INTERNALS
e81785da447b469da66f218b3f0244aab507958djorton# Name by which this script was invoked.
5cc1d035c9293c4d64b2344b5eac35edd1bd4537rpluemUsage: $program [-hVF] [-t TYPE] [-d DIRECTORY] [-s FS_TYPE] -f TAR_FILE
5cc1d035c9293c4d64b2344b5eac35edd1bd4537rpluemMake a Bootable IMAGE using GRUB as a bootloader
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton -d DIRECTORY [default CWD]
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton Directory where the boot.image and the partition subdirectories
00f53c09b10014571b639d5e9df993fb188220a6sf are/will be created
00f53c09b10014571b639d5e9df993fb188220a6sf -f TAR_FILE
00f53c09b10014571b639d5e9df993fb188220a6sf Name of the tar file containing the filesystem to install. Can
00f53c09b10014571b639d5e9df993fb188220a6sf be a pure tar file [.tar] or a compressed tar file
459eaf0826f995b73a0dc066f59ea10d2824e72dsf -s FS_TYPE
459eaf0826f995b73a0dc066f59ea10d2824e72dsf Type of the file system to create on the virtual disk. Choices
53e9b27aba029b18be814df40bcf6f0428771d1efuankg ext2 on GNU [default is ext2]
53e9b27aba029b18be814df40bcf6f0428771d1efuankg ext2, minix or msdos on GNU/Linux [default is ext2]
53e9b27aba029b18be814df40bcf6f0428771d1efuankg Type of the image to create. Choices are '1.20', '1.44', '1.60',
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf '1.68', '1.74', '2.88' or 'hd' [default is hd]
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf Force to set the set_dpt flag (unnecessary 99% of the time! Be
2876a591f17b0c6ed0cf28da929643965e67c953sf Informations:
2876a591f17b0c6ed0cf28da929643965e67c953sf turn Debugging on [xtrace]
976f49eaf81ffe917272e4f1834115dec06962b0sf display this Help and exit
38eb64d29a17648e108852de42f23335aecaa8f8sf -V|--version
5a1f28ac93914b4bae892c69ac4b3e670bc10da8nd display Version information and exit
5a1f28ac93914b4bae892c69ac4b3e670bc10da8ndCopyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
2ba1586475aa4ec972ca7c19b06d53bf76f0ee7efuankgCopyright (c) 2001,2002 Robert Millan <zeratul2@wanadoo.es>.
ca61ccd0c306c2c72df153688ba1b49f3eceed80sfWritten by Thierry Laronde and Robert Millan.
ca61ccd0c306c2c72df153688ba1b49f3eceed80sfCopyright (c) 2001,2002,2003 Thierry Laronde <tlaronde@polynum.org>.
6bb524f1895f30265a1431afc460977d391cb36bsfCopyright (c) 2001,2002,2003 Robert Millan <zeratul2@wanadoo.es>.
ca61ccd0c306c2c72df153688ba1b49f3eceed80sfThis is free software under the GPL version 2 or later; see the source for
6bb524f1895f30265a1431afc460977d391cb36bsfcopying conditions. There is NO warranty, not even for MERCHANTABILITY or
b40bfdb714672f972887f9f1f1e154e00125bb68covenerFITNESS FOR A PARTICULAR PURPOSE."
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin missing_argument) echo "You must give an argument to the option!";
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung missing_option) echo "You must indicate at least one option!";
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung must_be_root) echo "You must be root! (or install e2tools/mtools)";;
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung then echo "The GNU/Linux supported fs are: ext2, minix or msdos!";
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung elif [ $uname = GNU ];
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick unknown_format) echo "The tar file must be .tar|.tar.gz|.tar.bz2!";;
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick wont_fit) echo "The files won't fit on the selected type of media!";;
0827cb14e550f6f65018431c22c2c913631c8f25kbrand wrong_directory) echo "Directory inexistant or not given!";
cfa64348224b66dd1c9979b809406c4d15b1c137fielding wrong_type) echo "The type specified is not a valid one!";
cfa64348224b66dd1c9979b809406c4d15b1c137fielding# create a filesystem of type $fs in $image with offset $offset
ext2)
vfat)
if [ ! "$image_type" ]; then
cat <<EOF