Skip to content

Commit

Permalink
Add Kali Linux 32 bit for OrangePi Plus
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-popova committed Mar 6, 2019
1 parent f0b5bcc commit 9056275
Show file tree
Hide file tree
Showing 10 changed files with 1,417 additions and 28 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ The built image will be located in the `build` directory. By the way, you can sp

## Documentation

| | Alpine 3.9 | Devuan 1 «Jessie» | Debian 10 «Buster» | Raspbian 9 «Stretch» | Ubuntu 16.04 «Xenial Xerus» | Ubuntu 18.04 «Bionic Beaver» |
|---------------------------------------------------------------------------------------------|:--------------:|:---------------------:|:---------------------:|:---------------------:|:---------------------------:|:----------------------------:|
| Orange Pi [PC Plus](http://orangepi.org/orangepipcplus/) | | | 32bit | | | |
| Raspberry Pi [Model B and B+](https://www.raspberrypi.org/products/raspberry-pi-1-model-b/) | | | | 32bit | | |
| Raspberry Pi [2 Model B](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/) | 32bit | 32bit | | 32bit | 32bit | 32bit |
| Raspberry Pi [3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) | 32bit | 32bit | | 32bit | | 32bit, 64bit |
| Raspberry Pi [Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) | | | | 32bit | | |
| | Alpine 3.9 | Devuan 1 «Jessie» | Debian 10 «Buster» | Kali Linux rolling | Raspbian 9 «Stretch» | Ubuntu 16.04 «Xenial Xerus» | Ubuntu 18.04 «Bionic Beaver» |
|---------------------------------------------------------------------------------------------|:--------------:|:---------------------:|:---------------------:|:---------------------:|:---------------------:|:---------------------------:|:----------------------------:|
| Orange Pi [PC Plus](http://orangepi.org/orangepipcplus/) | | | 32bit | 32bit | | | |
| Raspberry Pi [Model B and B+](https://www.raspberrypi.org/products/raspberry-pi-1-model-b/) | | | | | 32bit | | |
| Raspberry Pi [2 Model B](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/) | 32bit | 32bit | | | 32bit | 32bit | 32bit |
| Raspberry Pi [3 Model B](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) | 32bit | 32bit | | | 32bit | | 32bit, 64bit |
| Raspberry Pi [Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/) | | | | | 32bit | | |

The operating system of the target image is specified via the `OS` environment variable. The next table maps full names of the supported operating systems to their short name intended for using as values of `OS`.

Expand All @@ -201,6 +201,7 @@ The operating system of the target image is specified via the `OS` environment v
| Alpine [3.9](https://alpinelinux.org/posts/Alpine-3.9.0-released.html) (32-bit) | alpine-3.9-armhf |
| Debian 10 «[Buster](https://debian.org/releases/buster/)» (32-bit) | debain-buster-armhf |
| Devuan 1 «[Jessie](https://lists.dyne.org/lurker/message/20170525.180739.f86cd310.en.html#devuan-announce)» (32-bit) | devuan-jessie-armhf |
| Kali Linux rolling (32-bit) | kali-rolling-armhf |
| Raspbian 9 «[Stretch](https://raspberrypi.org/blog/raspbian-stretch/)» (32-bit) | raspbian-stretch-armhf |
| Ubuntu 16.04 «[Xenial Xerus](https://wiki.ubuntu.com/XenialXerus/ReleaseNotes)» (32-bit) | ubuntu-xenial-armhf |
| Ubuntu 18.04 «[Bionic Beaver](https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes)» (32-bit) | ubuntu-bionic-armhf |
Expand Down
4 changes: 4 additions & 0 deletions devices/opi-pc-plus/kali-rolling-armhf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Kali Linux is a security-focused Debian-based distribution with pre-installed tools for penetration testing.
It is maintained by Offensive Security Ltd. `opi-pc-plus/kali-rolling-armhf` allows building custom 32-bit Kali Linux images for [OrangePi PC Plus](http://orangepi.org/orangepipcplus/).
## What's in the distribution?
Kali Linux has the rolling release cycle.
14 changes: 14 additions & 0 deletions devices/opi-pc-plus/kali-rolling-armhf/pieman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Maintainer: Polina Popova <[email protected]>

kali-rolling-armhf:
codename: kali-rolling
repos:
- http://http.kali.org/kali/
boot:
- /boot/initrd.img-*-armmp:initrd.img
- /boot/vmlinuz-*-armmp:zImage
- /usr/lib/linux-image-*-armmp/sun8i-h3-orangepi-pc-plus.dtb
base:
- gnupg
kernel:
package: linux-image-armmp
17 changes: 1 addition & 16 deletions essentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MENDER_CLIENT_REVISION="1.7.x"

PIEMAN_MAJOR_VER=0

PIEMAN_MINOR_VER=7
PIEMAN_MINOR_VER=8

PYTHON_MAJOR_VER=3

Expand Down Expand Up @@ -236,21 +236,6 @@ run_scripts() {
fi
}

# Splits the value of the OS variable into pieces and stores it to the PIECES
# array. OS must stick to the following naming convention:
# <distro name>-<codename>-<arch>.
# Globals:
# None
# Arguments:
# OS
# PIECES
# Returns:
# None
split_os_name_into_pieces() {
# shellcheck disable=SC2034
IFS='-' read -ra PIECES <<< ${OS}
}

# Writes "yes" or "no" to stderr depending on the condition.
# Globals:
# None
Expand Down
21 changes: 20 additions & 1 deletion helpers/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ is_alpine() {
# Returns:
# Boolean
is_debian_based() {
if [ "${PIECES[0]}" = "debian" ] || [ "${PIECES[0]}" = "devuan" ] || [ "${PIECES[0]}" = "raspbian" ] || [ "${PIECES[0]}" = "ubuntu" ]; then
if [ "${PIECES[0]}" = "debian" ] || [ "${PIECES[0]}" = "devuan" ] || [ "${PIECES[0]}" = "kali" ] || [ "${PIECES[0]}" = "raspbian" ] || [ "${PIECES[0]}" = "ubuntu" ]; then
true
else
false
Expand Down Expand Up @@ -561,3 +561,22 @@ set_traps() {
trap "cleanup && send_request_to_bsc_server FAILED_CODE && stop_bscd && exit 130" 2
trap "cleanup && send_request_to_bsc_server FAILED_CODE && stop_bscd" 1 3 6 ERR
}

# Splits the value of the OS variable into pieces and stores it to the PIECES
# array. OS must stick to the following naming convention:
# <distro name>-<codename>-<arch>.
# Globals:
# None
# Arguments:
# OS
# PIECES
# Returns:
# None
split_os_name_into_pieces() {
# shellcheck disable=SC2034
IFS='-' read -ra PIECES <<< "${OS}"
codename="$(get_attr_or_nothing "${OS}" codename)"
if [ ! -z "${codename}" ]; then
PIECES[1]="${codename}"
fi
}
Loading

0 comments on commit 9056275

Please sign in to comment.