make-initrd.sh 1.7 KB
Newer Older
Daniel Bissani Furlin's avatar
Daniel Bissani Furlin committed
1
#!/bin/bash
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
# le6-conf is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
Daniel Bissani Furlin's avatar
Daniel Bissani Furlin committed
22 23

_DIST=$1
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
_ARCH=$2
CHROOTDIR=$3
CHROOTFILE=$4
DISTRO=$5
DPLIST=$6
INSTLIST=$7
ISOLINUX=$8
MOUNTLIST=$9
OURSOURCESLIST=${10}
RMDSKT=${11}
RMLIST=${12}
SCRIPTSDIR=${13}
SHORTNAME=${14}
SOURCESLISTDEFAULT=${15}
TMP=${16}
OVERLAY=${17}
40
REPOPKGS=${18}
Daniel Bissani Furlin's avatar
Daniel Bissani Furlin committed
41 42 43 44
PREFIX=$PWD

source ${PREFIX}/common.sh

45 46
echo "CHROOTDIR = '${CHROOTDIR}'"
cp ${PREFIX}/vmlinuz-*-generic ${TMP}/image/casper/vmlinuz || exit 1
47 48 49 50 51 52 53 54 55 56 57 58
if ! test -f initrd.lz; then
    initname=$(ls "${PREFIX}/" | grep "initrd.*-generic")
    if [ ! -d ${PREFIX}/initrd ]; then
        mkdir ${PREFIX}/initrd
    else
        rm -rf ${PREFIX}/initrd/*
    fi
    echo "initname = '${initname}'"
    cd ${PREFIX}/initrd
    gzip -dc ${PREFIX}/${initname} | cpio -i
    find . | cpio --quiet -o -H newc | lzma -7 > ../initrd.lz
    cd ..
Daniel Bissani Furlin's avatar
Daniel Bissani Furlin committed
59
fi
60
cp initrd.lz ${TMP}/image/casper/initrd.lz || exit 1
Daniel Bissani Furlin's avatar
Daniel Bissani Furlin committed
61
exit 0