2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
12 # This is a temporary script - this should be rolled into a separate
13 # build target "make ci-iso" instead!
17 fusermount -u $tmporigdir 2>/dev/null
18 test -d $tmporigdir && mdir $tmporigdir
21 trap exit_handler exit
29 top=$(cd `dirname $0`; pwd)
30 origiso=$(cd `dirname $1`; echo `pwd`/`basename $1`)
31 newiso=$(cd `dirname $2`; echo `pwd`/`basename $2`)
33 tmporigdir=/${tmpdir}/origiso
34 tmpnewdir=/${tmpdir}/newiso
36 test -f $origiso || error_exit "Could not find origiso $origiso"
37 test -d $tmpdir || error_exit "Could not find tmpdir $tmpdir"
40 if [ "`whoami`" != "root" ]; then
41 error_exit "You need be root to run this script"
45 rm -Rf $tmporigdir $tmpnewdir
46 mkdir -p $tmporigdir $tmpnewdir
47 fuseiso $origiso $tmporigdir || error_exit "Failed fuseiso"
49 find . | cpio -pd $tmpnewdir
51 fusermount -u $tmporigdir
53 chmod -R 755 $tmpnewdir
57 # Patch ISO to make it suitable for automatic deployment
58 cat $top/ks.cfg.patch | patch -p0 || error_exit "Failed patch 1"
59 cat $top/isolinux.cfg.patch | patch -p0 || error_exit "Failed patch 2"
62 echo "Creating iso $newiso"
64 -J -R -b isolinux/isolinux.bin \
66 -boot-load-size 4 -boot-info-table \
68 -x "lost+found" -o $newiso . || error_exit "Failed making iso"