root/morphix/trunk/morph-scripts/add_to_iso_.sh

Revision 2, 2.9 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

  • Property svn:executable set to
Line 
1 #!/bin/bash
2 #
3 # Add files to an 0.5+ Morphix ISO
4 # First Draft - Lots of thing to clean up, ....
5 # Version: 1.1.1.1 Dated 2004-11-12
6 #
7 # Copyright (c) 2004, Brendan M. Sleight <bmsleight@morphix._REMOVE_SPAM_TRAP.org>
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; see the file COPYING.  If not, write to
21 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA
22
23
24 STARTISO="$1"
25 FINISHISO="$2"
26 FILES="$3"
27 ADDPATH="$4"
28
29 if [ -z "$STARTISO" -o -z "$FINISHISO" -o -z "$FILES" -o -z "$ADDPATH"  ]; then
30     echo "Usage: $0 starting.iso destination.iso /home/user/files_to_add/ /cdpath/"
31     echo "    bookmarks.xml is optional"
32     echo
33     echo "e.g. $0 /mnt/hda5/lunix.iso/firefox3.iso /mnt/hda5/lunix.iso/WebCafe01.iso /home/user/miscfiles/ /misc/"
34     echo
35     echo "This script generates a new iso, based on old iso"
36     echo "With the files add to the ISO, without copying all the files on the orginal ISO"
37     echo
38     exit
39 fi
40
41 mkdir /tmp/add_files/
42 mkdir /tmp/add_files/iso/
43 #mkdir /tmp/add_files/files/
44 mkdir /tmp/add_files/boot/
45 #mkdir /tmp/add_files/boot/grub/
46
47 #Mount the old iso so that we can extract the boot files..
48 mount $STARTISO /tmp/add_files/iso -o loop
49
50 #Have we a 0.4 or a 0.5 morphix - ripped from makeiso.sh
51 if [ -e "/tmp/add_files/iso/base/boot.img" ]; then
52         mkisofs -graft-points -pad -l -r -J -v -V "Morphix LiveCD" -b base/boot.img -c base/boot.cat -hide -rr -moved \
53          -o $FINISHISO /tmp/add_files/iso  /$ADDPATH=$FILES
54
55 elif [ -e "/tmp/add_files/iso/boot/grub/iso9660_stage1_5" ]; then
56         #This file needs to be rw not ro
57         cp /tmp/add_files/iso/boot/grub/iso9660_stage1_5 /tmp/add_files/boot/
58         mkisofs -graft-points -pad -l -r -J -v -V "Morphix LiveCD" -b boot/grub/iso9660_stage1_5 -c base/boot.cat \
59          -no-emul-boot -boot-load-size 4 -boot-info-table -hide -rr -moved -m /tmp/add_files/iso/boot/grub/iso9660_stage1_5 \
60          -o $FINISHISO /tmp/add_files/iso /boot/grub/=/tmp/add_files/boot/ /$ADDPATH=$FILES
61
62 elif [ -e "/tmp/add_files/iso/base/isolinux.bin" ]; then
63         mkisofs -graft-points -pad -l -r -J -v -V "Morphix LiveCD" -b base/isolinux/isolinux.bin -c base/boot.cat \
64          -no-emul-boot -boot-load-size 4 -boot-info-table -hide -rr -moved  -o $FINISHISO /tmp/add_files/iso /$ADDPATH=$FILES
65 else
66     echo "Error: unable to find bootloader in $STARTISO. Either update this script, or make sure you have the file as the ISO"
67 fi
68
69
70 umount $STARTISO
71 rm /tmp/add_files/ -R
Note: See TracBrowser for help on using the browser.