Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 70bf9d1cbf
Fetching contributors…

Cannot retrieve contributors at this time

executable file 203 lines (181 sloc) 5.354 kB
#!/bin/sh
# The master script that will make an OLPC XO compatible puppylinux build.
# from the content of this git repository, public sources, and a puppylinux
# ISO image file.
#
# GPL2 (see /usr/share/doc) (c) mavrothal, 01micko
# NO WARRANTY
#ver
VER=3
xoolpcfunc()
{
echo ""
echo -en "\033[1;33m""\t1""\033[0m" "|" "\033[1;32m" "L""\033[0m" \
"|""\033[1;36m"" ->""\033[0m" "|""\033[1;35m" "X"; echo -e "\033[0m"
echo ""
}
export -f xoolpcfunc
xoolpcfunc
#usage
usagefunc()
{
cat <<_USAGE
Usage:
This program will create a puppylinux version bootable on the OLPC
XO-1 and XO-1.5 hardware, from a puppy linux iso.
-h|--help display this usage
-v|--version display script version
-b|--build-iso [path/to/iso] the FULL pathname of the Puppy iso
-i|--iso [path/to/iso] like "-b" nut NO kernel building. Must have one
NOTE: This script must be run from one level above the "Pox_git" folder
eg:\`exec Pox_git/make_build -b <path>', \`./Pox_git/make_build -i <path>'
(c) Created by mavrothal and 01micko
@murga-linux puppy forum
GPLv2. See /usr/share/doc/legal/
NO WARRANTY
While all care is taken NO responsibility is accepted
_USAGE
xoolpcfunc
exit 0
}
export -f usagefunc
prepare()
{
NOWDIR=`pwd`
INSIDE=`echo $NOWDIR | grep Pxo_git`
if [ "$INSIDE" != "" ] ; then
echo -e "\\0033[1;31m"
echo "Run this script form _1_ level above the Pox_git folder"
echo -en "\\0033[0;39m"
sleep 5
usagefunc
fi
if [ ! -d "$NOWDIR"/*Pox_git* ] ; then
echo -e "\\0033[1;31m"
echo "Run this script form _1_ level above the Pox_git folder"
echo -en "\\0033[0;39m"
sleep 5
usagefunc
fi
#Make the working directory
mkdir $NOWDIR/"$BUILDNAME"_XO_build
WDIR="$NOWDIR/"$BUILDNAME"_XO_build"
# Create a build log
echo `date`, puppy-XO build on > $WDIR/build.log
echo `cat /etc/issue` >> $WDIR/build.log
if [ ! -f /etc/DISTRO_SPECS ] ; then
echo -e "\\0033[1;31m"
echo "This program may not run properly in other than Puppylinux, distros"
echo ""
echo "Hit \"c\" and then \"enter\" to take your chances "
echo "and continue... or just \"enter\" to stop."
echo -en "\\0033[0;39m"
read CONTINUE
if [ "$CONTINUE" = "c" ];then
echo "Building in a non-puppylinux distro. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
else
exit 0
fi
else
. /etc/DISTRO_SPECS
fi
# Clean and update the Pox_git
cd $NOWDIR/*Pox_git*
git reset --hard HEAD
git fetch
if [ $? -ne 0 ]; then
echo "Pox_git git update failed. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
fi
# Copy files from Pox_git into the work directory
cd $WDIR
cp -a $NOWDIR/*Pox_git*/*.sh .
cp -a $NOWDIR/*Pox_git*/pkgs_remrc .
cp -aR $NOWDIR/*Pox_git*/XO/XO_sfs* .
cp -aR $NOWDIR/*Pox_git*/XO/extra_pets .
cp -aR $NOWDIR/*Pox_git*/XO/XO_initrd/* .
cp -aR $NOWDIR/*Pox_git*/XO/XO_kernel_patches .
chmod 755 *.sh
sync
# and remove the .gitignore files
rm -f $WDIR/extra_pets/.gitignore
rm -f $WDIR/XO_sfs/.*/.gitignore
}
export -f prepare
run_all()
{
# Run the build scripts
echo "Starting kernel build. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
./XOpup_kernel_builder.sh -b
sync; sync
if [ ! -f $WDIR/boot10/vmlinuz ] && [ ! -f $WDIR/boot15/vmlinuz ] ; then
echo -e "\\0033[1;31m"
echo "Aborting! XO kernel build failed"
echo "Check $WDIR/build.log for more."
echo -en "\\0033[0;39m"
echo "Kernel build failed. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
exit 1
else
echo "Finished kernel build. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
fi
sleep 5
echo "Building XO_sfs files. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
./build_from_OLPC_git.sh -b
sync; sync
./build_aufs_util.sh
sync; sync
echo "Finished building XO_sfs files. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
sleep 5
echo "Building $BUILDNAME-XO . $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
./create_xo_puppy.sh -i "$ISOPATH"
sync; sync
echo "Finished building $BUILDNAME-XO . $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
}
export -f run_all
no_kernel()
{
# Use an existing kernel
if [ ! -f $WDIR/boot10/vmlinuz ] && [ ! -f $WDIR/boot15/vmlinuz ] ; then
echo -e "\\0033[1;31m"
echo " You do not have the XO kernels in the"
echo " $WDIR directory."
echo " Copy them over or run this script with the -b option"
echo -en "\\0033[0;39m"
exit 0
fi
echo "Building XO_sfs files. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
./build_from_OLPC_git.sh -b
sync; sync
./build_aufs_util.sh
sync; sync
echo "Finished building XO_sfs files. $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
sleep 5
echo "Building $BUILDNAME-XO . $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
./create_xo_puppy.sh -i "$ISOPATH"
sync; sync
echo "Finished building $BUILDNAME-XO . $(date "+%Y-%m-%d %H:%M")" >> $WDIR/build.log
}
export -f no_kernel
case "$#" in
0) usagefunc ;;
[3-9])echo "too many arguments"; usagefunc ;;
esac
case $1 in
-h|--help) usagefunc && exit 0 ;;
-v|--version) echo "$VER" && exit 0 ;;
-b|--build-iso) [ ! $2 ] && usagefunc
ISOPATH=$2
ISO="`basename $ISOPATH`"
BUILDNAME=`echo $ISO | sed 's/.iso//'`
# Need this to check if chrome driver is build correctly
export BUILDNAME
prepare
run_all;;
-i|--iso) [ ! $2 ] && usagefunc
ISOPATH=$2
ISO="`basename $ISOPATH`"
BUILDNAME=`echo $ISO | sed 's/.iso//'`
# Need this to check if chrome driver is build correctly
export BUILDNAME
prepare
no_kernel;;
esac
Jump to Line
Something went wrong with that request. Please try again.