2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: target/bootdisk/arch/x86/makeimages.sh
6 # Copyright (C) 2004 - 2005 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 if [ "$1" = -reroot ] ; then
17 echo "Old PATH: $PATH"
18 PATH
="../../sbin:../../bin:../../../sbin:../usr/bin:$PATH"
19 echo "New PATH: $PATH"
20 echo "Old LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
21 export LD_LIBRARY_PATH
="../../lib:../../usr/lib:$LD_LIBRARY_PATH"
22 LD_LIBRARY_PATH
=${LD_LIBRARY_PATH%:}
23 echo "New LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
27 if [ "$1" = -combo ] ; then
29 elif [ "$#" != 0 ] ; then
30 echo "usage: $0 [-reroot] [-combo]"
34 tmpfile
=`mktemp -p $PWD`
36 mkdir
$tmpdir ||
exit 1
40 for x
in /dev
/loop
/* ; do
41 if losetup
$x $tmpfile 2> /dev
/null
; then
45 if [ -z "$tmpdev" ] ; then
46 echo "No free loopback device found!"
47 rm -f $tmpfile ; rmdir $tmpdir
52 for image
in initrd boot_144 boot_288
56 echo "Creating ${image}.gz ..."
59 echo "Creating ${image}.img ..."
62 echo "Creating ${image}.img ..."
66 dd if=/dev
/zero of
=$tmpfile bs
=1024 count
=$size &> /dev
/null
67 losetup
-d $tmpdev ; losetup
$tmpdev $tmpfile || rc
=1
68 mke2fs
-q $tmpdev &> /dev
/null
; mount
$tmpdev $tmpdir || rc
=1
72 cp -a initrd
/* $tmpdir || rc
=1
76 cp -a boot
/{vmlinuz
,lilo-help.txt
} $tmpdir || rc
=1
77 if [ -f /boot
/boot-text.b
]; then
78 cp /boot
/boot-text.b
$tmpdir/boot.b || rc
=1
80 liloconf
=lilo-conf-
${image#boot_}
81 if [ $image = boot_288
-o "$combo" = 1 ] ; then
82 cp initrd.gz
$tmpdir || rc
=1
83 [ $image = boot_144
] && liloconf
=lilo-conf-1x2
85 sed -e "s,/mnt/,$tmpdir/,g" \
86 -e "s,/dev/floppy/0,$tmpdev,;" \
87 < boot
/$liloconf > $tmpdir/lilo.conf || rc
=1
88 lilo
-C $tmpdir/lilo.conf
> /dev
/null || rc
=1
95 initrd
) gzip -9 < $tmpfile > $image.gz || rc
=1 ;;
96 *) cp $tmpfile $image.img || rc
=1 ;;