about summary refs log blame commit diff stats
path: root/core/scripts/install-core.sh
blob: d889c8ba61ddb868acac55d2662e792c01105f44 (plain) (tree)
























































                                                                                             

                                                










                                                     
                                                                            



















































                                                                                





                                                                           







                            
#!/bin/bash

CHROOT="/mnt"
PORT_PKG="${CHROOT}/media/crux"

#echo "1.1.8. Install Handbook\n"
#cp ${PORT_PKG}/handbook.txt $CHROOT/root/

ConfirmOrExit()
{
    while true
    do
        echo -n "Please confirm (y or n) :"
        read CONFIRM
        case $CONFIRM in
            y|Y|YES|yes|Yes) break ;;
            n|N|no|NO|No)
                echo "Aborting - you entered $CONFIRM"
                exit
                ;;
            *) echo "Please enter only y or n"
        esac
    done
    echo "You entered $CONFIRM. Continuing ..."
}


install_core() {

    mkdir -p ${CHROOT}/var/lib/pkg
    touch ${CHROOT}/var/lib/pkg/db

    CORE_LS="${DATA_DIR}/core.pkg"

    if [ ! -f ${CORE_LS} ]; then
        CORE_LS=${CHROOT}/core.pkg
        echo "1.1.4 Create core.pkg and install pkgadd"
        for p in ${PORT_PKG}/core/*;
        do
            echo $(basename $p) >> ${CORE_LS};
        done
    fi

    tar xf "${PORT_PKG}/core/pkgutils#5.40-1.pkg.tar.xz" usr/bin/pkgadd -O > ${CHROOT}/pkgadd

    chmod +x ${CHROOT}/pkgadd

    echo "1.1.4 File core.pkg complete, review list of packages before continue..."
    read PAUSE
    vim ${CORE_LS}

    echo "1.1.4 Starting install"

    #cd $CHROOT
    while read line; do
        pkg=${PORT_PKG}/core/${line}
        echo "Installing ${pkg};\n"
        #${CHROOT}/pkgadd -f -r ${CHROOT} ${pkg}
        pkgadd -f -r ${CHROOT} ${pkg}
    done < ${CORE_LS}

    rm ${CHROOT}/pkgadd

    if [ -f ${CHROOT}/core.pkg ]; then
        rm ${CHROOT}/core.pkg;
    fi
}

install_packages() {
    echo "Installing $CHROOT/media/crux/opt/fakeroot"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT ${CHROOT}/media/crux/opt/fakeroot#*
    echo "Installing $CHROOT/media/crux/opt/dbus"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/dbus#*
    echo "Installing $CHROOT/media/crux/opt/expat"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/expat#*
    echo "Installing $CHROOT/media/crux/opt/libnl"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libnl#*
    echo "Installing $CHROOT/media/crux/opt/libpng"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libpng#*
    echo "Installing $CHROOT/media/crux/opt/freetype"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/freetype#*
    echo "Installing $CHROOT/media/crux/opt/libffi"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libffi#*
    echo "Installing $CHROOT/media/crux/opt/sqlite3"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/sqlite3#*
    echo "Installing $CHROOT/media/crux/opt/python"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/python#*
    echo "Installing $CHROOT/media/crux/opt/glib"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/glib#*
    echo "Installing $CHROOT/media/crux/opt/grub2"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/grub2#*
    echo "Installing $CHROOT/media/crux/opt/grub2-efi"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/grub2-efi#*
    echo "Installing $CHROOT/media/crux/opt/wireless-tools"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/wireless-tools#*
    echo "Installing $CHROOT/media/crux/opt/wpa_supplicant"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/wpa_supplicant#*
    echo "Installing $CHROOT/media/crux/opt/lvm2"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/lvm2#*
    echo "Installing $CHROOT/media/crux/opt/mdadm"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/mdadm#*
    echo "Installing $CHROOT/media/crux/opt/efivar"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/efivar#*
    echo "Installing $CHROOT/media/crux/opt/efibootmgr"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/efibootmgr#*
    echo "Installing $CHROOT/media/crux/opt/dosfstools"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/dosfstools#*
    echo "Installing $CHROOT/media/crux/opt/parted"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/parted#*
    echo "Installing $CHROOT/media/crux/opt/libgcrypt"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libgcrypt#*
    echo "Installing $CHROOT/media/crux/opt/cryptsetup"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/cryptsetup#*
    echo "Installing $CHROOT/media/crux/opt/popt"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/popt#*
    echo "Installing $CHROOT/media/crux/opt/libgpg-error"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libgpg-error#*
    echo "Installing $CHROOT/media/crux/opt/libevent"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libevent#*
    echo "Installing $CHROOT/media/crux/opt/libtirpc"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/libtirpc#*
    echo "Installing $CHROOT/media/crux/opt/git"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/git#*
    echo "Installing $CHROOT/media/crux/opt/tmux"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/tmux#*
    echo "Installing $CHROOT/media/crux/opt/prt-utils"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/prt-utils#*
    echo "Installing $CHROOT/media/crux/opt/elfutils"
    $CHROOT/usr/bin/pkgadd -f -r $CHROOT $CHROOT/media/crux/opt/elfutils#*
}

echo "PORT_PKG=${PORT_PKG}";
echo "CHROOT=$CHROOT";

ConfirmOrExit
install_core
install_packages