Skip to content

Commit

Permalink
Merge pull request #316 from viraniac/fenix-config
Browse files Browse the repository at this point in the history
Add fenix-config
  • Loading branch information
numbqq authored Aug 22, 2024
2 parents 80607bd + 89844ca commit 6c416a8
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/config
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ if [[ "$DISTRIB_TYPE" != "minimal" ]]; then
iperf3 software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping \
bluetooth bluez bluez-tools watchdog i2c-tools qrencode clinfo ocl-icd-libopencl1 libatlas3-base \
p7zip p7zip-full lrzip lzip lzop ncompress unar zstd edid-decode libgtk-3-0 dnsmasq-base ppp \
modemmanager mobile-broadband-provider-info zlib1g-dev avahi-utils"
modemmanager mobile-broadband-provider-info zlib1g-dev avahi-utils zip"
fi

PACKAGE_LIST_DESKTOP="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-fuse xfonts-base xinit x11-xserver-utils thunar-volman \
Expand Down
12 changes: 12 additions & 0 deletions config/functions/build-common-deb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ build_common_deb() {
rm -rf $BUILD/.stamps/dt-overlays-debs
build_package "dt-overlays-debs:target"
fi

info_msg "Building fenix-config packages..."
# FIXME
# remove build stamp to force build for other arch
rm -rf $BUILD/.stamps/fenix-config
build_package "fenix-config:target"
}

## Build common deb package
Expand All @@ -46,4 +52,10 @@ install_common_deb() {
install_deb_chroot $BUILD_DEBS/$VERSION/$KHADAS_BOARD/${DISTRIBUTION}-${DISTRIB_RELEASE}/dt-overlays-debs/*.deb
fi
fi

# Install fenix-config in chroot
if [ -n "$(ls $BUILD_DEBS/$VERSION/$KHADAS_BOARD/${DISTRIBUTION}-${DISTRIB_RELEASE}/fenix-config/ -1)" ]; then
info_msg "Installing fenix-config package..."
install_deb_chroot $BUILD_DEBS/$VERSION/$KHADAS_BOARD/${DISTRIBUTION}-${DISTRIB_RELEASE}/fenix-config/fenix-config_*.deb
fi
}
59 changes: 59 additions & 0 deletions packages/fenix-config/package.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
PKG_NAME="fenix-config"
PKG_VERSION="de4772153a306df6fc25e8e9c06281f208479017"
PKG_SHA256="3b201dd8425c50dad89be372e649cf7f510e5f3e4eda9c7b633b6913635bbd47"
PKG_SOURCE_DIR="${PKG_NAME}-${PKG_VERSION}*"
PKG_SITE="$GITHUB_URL/numbqq/${PKG_NAME}"
PKG_URL="$PKG_SITE/archive/$PKG_VERSION.tar.gz"
PKG_ARCH="arm aarch64"
PKG_LICENSE="GPL"
PKG_SHORTDESC="Linux configuration utility"
PKG_SOURCE_NAME="${PKG_NAME}-${PKG_VERSION}.tar.gz"
PKG_NEED_BUILD="YES"


make_target() {
local pkgdir="$BUILD_IMAGES/.tmp/${PKG_NAME}_${VERSION}_${DISTRIB_ARCH}"
rm -rf $pkgdir
mkdir -p $pkgdir/DEBIAN

# set up control file
cat <<-EOF > $pkgdir/DEBIAN/control
Package: ${PKG_NAME}
Version: ${VERSION}
Architecture: all
Maintainer: Khadas <[email protected]>
Depends: bash, bc, build-essential, curl, dialog, debconf, debconf-utils, dirmngr, expect, html2text, iperf3, jq, psmisc, pv, software-properties-common, unzip, zip
Suggests: libpam-google-authenticator, qrencode, network-manager
Section: utils
Priority: optional
Description: Fenix configuration utility
EOF

mkdir -p "${pkgdir}"/usr/{bin,lib/fenix-config,sbin}
install -m 755 fenix-config "${pkgdir}"/usr/sbin/fenix-config
install -m 644 fenix-config-jobs "${pkgdir}"/usr/lib/fenix-config/jobs.sh
install -m 644 fenix-config-submenu "${pkgdir}"/usr/lib/fenix-config/submenu.sh
install -m 644 fenix-config-functions "${pkgdir}"/usr/lib/fenix-config/functions.sh
install -m 644 fenix-config-functions-network "${pkgdir}"/usr/lib/fenix-config/functions-network.sh
install -m 755 softy "${pkgdir}"/usr/sbin/softy

ln -sf /usr/sbin/fenix-config "${pkgdir}"/usr/bin/fenix-config
ln -sf /usr/sbin/softy "${pkgdir}"/usr/bin/softy

info_msg "Building package: $pkgname"
fakeroot dpkg-deb -b -Zxz $pkgdir ${pkgdir}.deb

# Cleanup
rm -rf $pkgdir
}

makeinstall_target() {
local pkgdir="$BUILD_IMAGES/.tmp/${PKG_NAME}_${VERSION}_${DISTRIB_ARCH}"
mkdir -p $BUILD_DEBS/$VERSION/$KHADAS_BOARD/${DISTRIBUTION}-${DISTRIB_RELEASE}/${PKG_NAME}/
# Remove old debs
rm -rf $BUILD_DEBS/$VERSION/$KHADAS_BOARD/${DISTRIBUTION}-${DISTRIB_RELEASE}/${PKG_NAME}/*
cp ${pkgdir}.deb $BUILD_DEBS/$VERSION/$KHADAS_BOARD/${DISTRIBUTION}-${DISTRIB_RELEASE}/${PKG_NAME}/

# Cleanup
rm -f ${pkgdir}.deb
}

0 comments on commit 6c416a8

Please sign in to comment.