Commit 9f1ab128 authored by Strit's avatar Strit

[buildarmpkg] Add the -k option to keep the previous rootfs, so you don't have...

[buildarmpkg] Add the -k option to keep the previous rootfs, so you don't have to generate new ones for each package
parent 31c26ba2
......@@ -52,7 +52,7 @@ Options inside [] are optional. Use `-h` to see what the defaults are.
**Syntax**
```
buildarmpkg -p package [-a architecture]
buildarmpkg -p package [-a architecture] [-k]
```
To build an armv7h package, place yourself in the folder, that contains a folder with the PKGBUILD, named as the package you want to build. Then run:
......@@ -61,7 +61,7 @@ To build an armv7h package, place yourself in the folder, that contains a folder
buildarmpkg -p package -a armv7h
```
This will build the package called "package" for the armv7h architecture.
This will build the package called "package" for the armv7h architecture in the previous rootfs generated.
To build an aarch64 package it's the same, just with
......
......@@ -2,12 +2,13 @@
# Set globals
LIBDIR=/usr/share/manjaro-arm-tools/lib
BUILDCLEAN=true
#imports
source $LIBDIR/functions.sh
#Arguments
opt=":p:a:h"
opt=":p:a:kh"
while getopts "${opt}" arg; do
case $arg in
......@@ -17,6 +18,9 @@ while getopts "${opt}" arg; do
a)
ARCH="${OPTARG}"
;;
k)
BUILDCLEAN=false
;;
\?)
echo "Invalid option: -${OPTARG}"
exit 1
......@@ -46,8 +50,14 @@ fi
# start the timer
timer_start=$(get_timer)
if [[ "$BUILDCLEAN" = "true" ]]; then
if [[ ! -d $BUILDDIR/$ARCH ]]; then
msg "Rootfs does not exist. Please run this command again without the -k option to generate a rootfs to use..."
exit 1
fi
#create the rootfs to build in
create_rootfs_pkg
fi
#build the package
build_pkg
......
......@@ -612,13 +612,13 @@ export_and_clean() {
msg "Package saved as {$PACKAGE} in {$PKGDIR/$ARCH}..."
#clean up rootfs
info "Cleaning rootfs..."
sudo rm -rf $BUILDDIR/$ARCH > /dev/null
info "Cleaning build files from rootfs"
sudo rm -rf $BUILDDIR/$ARCH/build/
else
msg "!!!!! Package failed to build !!!!!"
info "Cleaning rootfs"
sudo rm -rf $BUILDDIR/$ARCH > /dev/null
info "Cleaning build files from rootfs"
sudo rm -rf $BUILDDIR/$ARCH/build/
exit 1
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment