Commit 395a7311 authored by Strit's avatar Strit

remove all entried of sudo. Scripts now require sudo or root permissions to run

parent dbd6effb
......@@ -54,13 +54,13 @@ Options inside [] are optional. Use `-h` to see what the defaults are.
**Syntax**
```
buildarmpkg -p package [-a architecture] [-k] [-i package file]
sudo buildarmpkg -p package [-a architecture] [-k] [-i package file]
```
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:
```
buildarmpkg -p package -a armv7h
sudo buildarmpkg -p package -a armv7h
```
This will build the package called "package" for the armv7h architecture in the previous rootfs generated.
......@@ -68,13 +68,13 @@ This will build the package called "package" for the armv7h architecture in the
To build an aarch64 package it's the same, just with
```
buildarmpkg -p package -a aarch64
sudo buildarmpkg -p package -a aarch64
```
You can also build `any` packages, which will use the aarch64 architecture to build from.
```
buildarmpkg -p package -a any
sudo buildarmpkg -p package -a any
```
This places the packages created inside `/var/cache/manjaro-arm-tools/pkg/` in either armv7h folder or aarch64 folder.
......@@ -144,25 +144,25 @@ Profiles that gets used are on the [Gitlab.com](https://gitlab.com/Strit/arm-pro
**Syntax**
```
buildarmimg [-d device] [-e edition] [-v version] [-u username] [-p password] [-n] [-x] [-i package file]
sudo buildarmimg [-d device] [-e edition] [-v version] [-u username] [-p password] [-n] [-x] [-i package file]
```
To build a minimal image version 18.07 for the raspberry pi 3:
```
buildarmimg -d rpi3 -e minimal -v 18.07
sudo buildarmimg -d rpi3 -e minimal -v 18.07
```
To build a minimal version 18.08 RC1 for the odroid-c2 with a new rootfs downloaded:
```
buildarmimg -d oc2 -e minimal -v 18.08-rc1 -n
sudo buildarmimg -d oc2 -e minimal -v 18.08-rc1 -n
```
To build an lxqt version with a local package installed for the rock64:
```
buildarmimg -d rock64 -e lxqt -i package-name-1.0-1-aarch64.pkg.tar.xz
sudo buildarmimg -d rock64 -e lxqt -i package-name-1.0-1-aarch64.pkg.tar.xz
```
## buildarmoem
......@@ -175,17 +175,17 @@ This script does exactly what it says it does. It builds a very small rootfs, to
**Syntax**
```
buildrootfs -a arch
sudo buildrootfs -a arch
```
To build an armv7h rootfs:
```
buildrootfs -a armv7h
sudo buildrootfs -a armv7h
```
To build an aarch64 rootfs:
```
buildrootfs -a aarch64
sudo buildrootfs -a aarch64
```
## deployarmimg
......
......@@ -8,6 +8,12 @@ EXTRACTED=false
#imports
source $LIBDIR/functions.sh
# check if root
if [ "$EUID" -ne 0 ]
then echo "This script requires root permissions to run. Please run as root or with sudo!"
exit
fi
#Arguments
opt=":e:d:v:u:p:i:nxh"
......
......@@ -8,6 +8,12 @@ EXTRACTED=false
#imports
source $LIBDIR/functions.sh
# check if root
if [ "$EUID" -ne 0 ]
then echo "This script requires root permissions to run. Please run as root or with sudo!"
exit
fi
#Arguments
opt=":e:d:v:i:nxh"
......
......@@ -7,6 +7,12 @@ BUILDCLEAN=true
#imports
source $LIBDIR/functions.sh
# check if root
if [ "$EUID" -ne 0 ]
then echo "This script requires root permissions to run. Please run as root or with sudo!"
exit
fi
#Arguments
opt=":p:a:i:kh"
......
......@@ -7,52 +7,58 @@ ARCH="aarch64"
#imports
source $LIBDIR/functions.sh
# check if root
if [ "$EUID" -ne 0 ]
then echo "This script requires root permissions to run. Please run as root or with sudo!"
exit
fi
# Functions
create_rootfs () {
msg "Creating rootfs..."
# backup host mirrorlist
sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist-orig
mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist-orig
# Create arm mirrorlist
echo "Server = http://manjaro-arm.moson.eu/stable/\$arch/\$repo/" > mirrorlist
sudo mv mirrorlist /etc/pacman.d/mirrorlist
mv mirrorlist /etc/pacman.d/mirrorlist
# Remove old rootfs if it exists
if [ -d $BUILDDIR/$ARCH ]; then
echo "Removing old rootfs..."
sudo rm -rf $BUILDDIR/$ARCH
rm -rf $BUILDDIR/$ARCH
fi
# cd to root_fs
sudo mkdir -p $BUILDDIR/$ARCH
mkdir -p $BUILDDIR/$ARCH
# basescrap the rootfs filesystem
sudo pacstrap -G -c -C $LIBDIR/pacman.conf.$ARCH $BUILDDIR/$ARCH pacman
pacstrap -G -c -C $LIBDIR/pacman.conf.$ARCH $BUILDDIR/$ARCH pacman
# Enable cross architecture Chrooting
if [[ "$ARCH" = "aarch64" ]]; then
sudo cp /usr/bin/qemu-aarch64-static $BUILDDIR/$ARCH/usr/bin/
cp /usr/bin/qemu-aarch64-static $BUILDDIR/$ARCH/usr/bin/
else
sudo cp /usr/bin/qemu-arm-static $BUILDDIR/$ARCH/usr/bin/
cp /usr/bin/qemu-arm-static $BUILDDIR/$ARCH/usr/bin/
fi
# fix SSL in the rootfs
sudo rm -f $BUILDDIR/$ARCH/etc/ssl/certs/ca-certificates.crt
sudo rm -f $BUILDDIR/$ARCH/etc/ca-certificates/extracted/tls-ca-bundle.pem
sudo cp -a /etc/ssl/certs/ca-certificates.crt $BUILDDIR/$ARCH/etc/ssl/certs/
sudo cp -a /etc/ca-certificates/extracted/tls-ca-bundle.pem $BUILDDIR/$ARCH/etc/ca-certificates/extracted/
rm -f $BUILDDIR/$ARCH/etc/ssl/certs/ca-certificates.crt
rm -f $BUILDDIR/$ARCH/etc/ca-certificates/extracted/tls-ca-bundle.pem
cp -a /etc/ssl/certs/ca-certificates.crt $BUILDDIR/$ARCH/etc/ssl/certs/
cp -a /etc/ca-certificates/extracted/tls-ca-bundle.pem $BUILDDIR/$ARCH/etc/ca-certificates/extracted/
# restore original mirrorlist to host system
sudo mv /etc/pacman.d/mirrorlist-orig /etc/pacman.d/mirrorlist
sudo pacman -Syy
mv /etc/pacman.d/mirrorlist-orig /etc/pacman.d/mirrorlist
pacman -Syy
}
compress_rootfs () {
msg "Compressing rootfs..."
cd $BUILDDIR/$ARCH
sudo tar -czf $IMGDIR/Manjaro-ARM-$ARCH-latest.tar.gz .
sudo rm -rf $BUILDDIR/$ARCH
tar -czf $IMGDIR/Manjaro-ARM-$ARCH-latest.tar.gz .
rm -rf $BUILDDIR/$ARCH
}
......
This diff is collapsed.
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