Skip to content

Commit

Permalink
More branding and building un-hardcoding. Remove all GRUB features. M…
Browse files Browse the repository at this point in the history
…ove user cfg files to an ukuu dir.
  • Loading branch information
Brian K. White committed Mar 12, 2019
1 parent 466dd2e commit f2f35b3
Show file tree
Hide file tree
Showing 29 changed files with 1,481 additions and 1,855 deletions.
14 changes: 14 additions & 0 deletions BRANDING.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is in Makefile format

# The goal is to define these values in a single place,
# and have as many other places as possible all refer to this.

# Use Makefile syntax, as this is actually included by other makefiles,
# but keep it simple enough that it can also be parsed easily by anything else.

BRANDING_SHORTNAME = ukuu
BRANDING_LONGNAME = Ubuntu Kernel Update Utility
BRANDING_VERSION = 18.9
BRANDING_AUTHORNAME = Brian K. White
BRANDING_AUTHOREMAIL = [email protected]
BRANDING_WEBSITE = https://github.com/aljex/ukuu
6 changes: 0 additions & 6 deletions BUILD_CONFIG

This file was deleted.

18 changes: 18 additions & 0 deletions MKDEB_TARGETS
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is sourced by build-deb.sh , use bash syntax.

# DEBS[]
# Optional: Specify the distributions & architectures to generate *.deb
# files for. Defaut = single target same as host, IE: MKDEBS[disco]=amd64
# Format is a bash associative array with [dist]=arch,arch,arch,...

# Don't try to build for xenial:
# Gtk/TerminalWindow.vala:242.19-242.29: error: Argument 1: Cannot convert from `char[]' to `string'
# term.feed_child(c.to_utf8());
# ^^^^^^^^^^^

# just let it do the default
#declare -A DEBS=(
# [xenial]=i386,amd64
# [cosmic]=i386,amd64
# [disco]=i386,amd64
#)
80 changes: 36 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,47 @@

This is a tool for installing the latest mainline Linux kernel on Ubuntu-based distributions.

![](https://2.bp.blogspot.com/-76C_l3BcJyg/WNdzTpSoiKI/AAAAAAAAGKs/xOvB-LCH2cYiDpdbqWkeOLhY9I7TVACJwCLcB/s1600/ukuu_main_window.png)

### About This Fork

Since the original author stopped maintaining the free version of Ukuu and turned to a [paid version](https://teejeetech.in/tag/ukuu/), Several people have forked this project, and this is but one more. This fork started with https://github.com/stevenpwered/ukuu, and merged in https://github.com/cloyce/ukuu, and then I intend to add my own tweaks:

* First TODO Item (not done yet): STOP SAVING 6 GIGS OF KERNEL PACKAGES IN ~/.cache/ukuu HOLY GOBSMACK WTF ?????
<pre>
bkw@negre:~$ du -sh .cache/ukuu
5.5G .cache/ukuu
</pre>
Until then: As a work-around, you can create a wrapper shell script or menu entry to always run "ukuu --clean-cache" after "ukuu-gtk"

* Remove all grub options. A kernel package installer has no business messing with grub. dpkg already does the necessary part, which is just adding/removing entries without making any other changes.

### Enhancements

* Option in settings to skip internet connection check

Please feel free to submit a feature request in the Issues section.
![Main window screenshot](main_window.png)

### Features

* Fetches list of kernels from [kernel.ubuntu.com](http://kernel.ubuntu.com/~kernel-ppa/mainline/)
* Displays notifications when a new kernel update is available.
* Downloads and installs packages automatically

### Screenshots

![](https://2.bp.blogspot.com/-76C_l3BcJyg/WNdzTpSoiKI/AAAAAAAAGKs/xOvB-LCH2cYiDpdbqWkeOLhY9I7TVACJwCLcB/s1600/ukuu_main_window.png)
_Main Window_

![](https://2.bp.blogspot.com/-ATv4vsOVOnc/WNdztEZHJNI/AAAAAAAAGKw/1pOIuyu8ITo4z8mnMK6MfCZ3T_Nd4gQNQCLcB/s1600/ukuu_settings.png)
_Settings Window_

![](https://4.bp.blogspot.com/-Y-1zhHcpk1M/WNd42_ybTyI/AAAAAAAAGLE/gLaBdWpoh54OGrvF81Ka1bCVJjZ0WqKrQCLcB/s1600/ukuu_console_options.png)
_Console Options_
* Fetches list of available kernels from [Ubuntu Mainline PPA](http://kernel.ubuntu.com/~kernel-ppa/mainline/)
* Optionally watches and displays notifications when a new kernel update is available
* Downloads and installs packages automatically
* Display available and installed kernels conveniently
* Install/remove kernels from gui
* For each kernel, the related packages (headers & modules) are installed or removed at the same time

### Downloads & Source Code
Ukuu is written using Vala and GTK3 toolkit. Source code and binaries are available from the [GitHub project page](https://github.com/aljex/ukuu).

### Build instruction
### Build
sudo apt install libgee-0.8-dev libjson-glib-dev libvte-2.91-dev valac
git clone https://github.com/aljex/ukuu.git
cd ukuu
make
sudo make install

#### Ubuntu-based Distributions (Ubuntu, Linux Mint, Elementary, etc)

in a terminal window:

sudo apt install libgee-0.8-dev libjson-glib-dev libvte-2.91-dev valac
git clone https://github.com/aljex/ukuu.git
cd ukuu
make all
sudo make install
### About This Fork
The original author stopped maintaining the original GPL version of ukuu and switched to a [paid license](https://teejeetech.in/tag/ukuu/) for future versions. So, several people have forked that project, and this is one.

### Enhancements / Deviations from the original author's final GPL version

* (from [stevenpowerd](https://github.com/stevenpowered/ukuu)) Option to skip internet connection check
* (from [cloyce](https://github.com/cloyce/ukuu)) Option to include or hide pre-release kernels
* Removed all GRUB options
* Removed all donate buttons, links, dialogs

### Development Plans / TODO
* Stop consuming over 5GB in ```~/.cache/ukuu``` with kernel package files
:Until then: As a work-around, "ukuu --clean-cache" deletes the cache
* Better (more automatic) initial sizes for the window and the columns in the kernel list display so you don't have to manually expand them
* More efficient download & caching of info about available kernels, without the kernel packages
* Clean up build warnings
* Clean up run-time GTK warnings
* Make http client configurable (curl/wget/other)
* Reduce dependencies, stop using aptitude just to query installed packages when you can get the info from apt or even dpkg, use the same download client for everything instead of using both curl and aria
* Customizable appearance
* Option to specify kernel variant (generic, lowlatency, snapdragon, etc...)
* Configurable version threshhold instead of arbitrary hard-coded "hide older than 4.0"
* Improve the annoying pkexec behavior. It would be nicer to run lxqt-sudo or gsudo or pkexec etc one time for the whole session, and only have to enter a password once, instead of once per user action. But currently, if you do that, it creates files in the users home directory that are owned by root, which the user cannot then remove.
89 changes: 58 additions & 31 deletions build-deb.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,77 @@
#!/bin/bash
# Generates .deb packages
# Requires (at least):
# apt install ubuntu-dev-tools # install pbuilder-dist
# pbuilder-dist cosmic i386 create # create a build environment
# pbuilder-disp cosmic amd64 create # create a build environment
# 2019 Brian K. White <[email protected]>
# Requires (one time):
# sudo apt install ubuntu-dev-tools # install pbuilder-dist
# pbuilder-dist cosmic i386 create # create a build environment, repeat for all dists & arches
# Requires (periodically):
# pbuilder-disp cosmic amd64 update # update a build environment, repeat for all dists & arches

backup=${PWD}
DIR=${0%*/}
cd $DIR
################################################################################
# functions

. ./BUILD_CONFIG
abrt () { echo -e "${SELF}: ${@:-Failed}" >&2 ; exit 1 ; }

sh build-source.sh
_mkdeb () {
echo ""
echo "=========================================================================="
echo " ${SELF}: dist=\"${dist}\" arch=\"${arch}\""
echo "=========================================================================="
echo ""

build_deb_for_dist() {
[[ "${dist}" ]] || abrt "_mkdeb(): Missing \"dist\""
[[ "${arch}" ]] || abrt "_mkdeb(): Missing \"arch\""

dist=$1
arch=$2
# check if base.tgz exists
unset a
[[ "${arch}" == "${host_arch}" ]] || a="-${arch}"
b=~/pbuilder/${dist}${a}-base.tgz
[[ -f ${b} ]] || abrt "Missing ${b}\nRun \"pbuilder-dist ${dist} ${arch} create\""
# TODO - check if base.tgz is old, and automatically run "pbuilder-dist ... update"

echo ""
echo "=========================================================================="
echo " build-deb.sh : $dist-$arch"
echo "=========================================================================="
echo ""
mkdir -pv release/${dist}/${arch}

mkdir -pv release/${arch}
CMD="pbuilder-dist ${dist} ${arch} build release/source/${BRANDING[SHORTNAME]}*.dsc --buildresult release/${dist}/${arch}"
${CMD} || abrt "Failed: \"${CMD}\""

echo "-------------------------------------------------------------------------"
mv release/${dist}/${arch}/${BRANDING[SHORTNAME]}*.deb release/${dist}/${BRANDING[SHORTNAME]}-v${PKG_VERSION}-${arch}.deb || abrt

pbuilder-dist $dist $arch build release/source/${pkg_name}*.dsc --buildresult release/$arch
}

if [ $? -ne 0 ]; then cd "$backup"; echo "Failed"; exit 1; fi
################################################################################
# main

echo "--------------------------------------------------------------------------"
SELF=${0##*/}
cd ${0%/*} || abrt "Failed cd to \"${0%/*}\""

cp -pv --no-preserve=ownership release/${arch}/${pkg_name}*.deb release/${pkg_name}-v${pkg_version}-${arch}.deb
# get pkg name from BRANDING.mak
unset BRANDING ;declare -A BRANDING
[[ -s BRANDING.mak ]] && while read k x v ;do
[[ "${k}" =~ ^BRANDING_ ]] && BRANDING[${k#*_}]="${v}"
done < BRANDING.mak
[[ ${BRANDING[SHORTNAME]} ]] || abrt "Missing BRANDING_SHORTNAME (check BRANDING.mak)"

if [ $? -ne 0 ]; then cd "$backup"; echo "Failed"; exit 1; fi
# get pkg version from debian/changelog (not branding.mak)
PKG_VERSION=`dpkg-parsechangelog --show-field Version`

echo "--------------------------------------------------------------------------"
# get deb build targets
host_dist=`lsb_release -sc`
host_arch=`dpkg --print-architecture`
unset DEBS
[[ -s MKDEB_TARGETS ]] && . ./MKDEB_TARGETS # no err if not present
[[ "${#DEBS[@]}" -lt 1 ]] && declare -A DEBS[${host_dist}]=${host_arch} # default

}
export host_dist host_arch BRANDING PKG_VERSION

# generate the source dsc and tar files
./build-source.sh || abrt "Failed: build-source.sh"

# generate debs
for dist in ${!DEBS[@]} ;do
for arch in ${DEBS[${dist}]//,/ } ;do _mkdeb ;done
done

build_deb_for_dist cosmic i386
build_deb_for_dist cosmic amd64
#build_deb_for_dist stretch armel
#build_deb_for_dist stretch armhf
echo
echo "Generated:"
find release -type f -name '*.deb'

cd "$backup"
55 changes: 0 additions & 55 deletions build-installers.sh

This file was deleted.

45 changes: 25 additions & 20 deletions build-source.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
#!/bin/bash
# Generates debian source dsc and tar files
# This is run by build-deb.sh

backup=${PWD}
DIR=${0%/*}
cd "$DIR"
################################################################################
#functions

. ./BUILD_CONFIG
abrt () { echo "${SELF}: ${@:-Failed}" >&2 ; exit 1 ; }

################################################################################
# main

SELF=${0##*/}
cd ${0%/*} || abrt "Failed to cd \"${0%/*}\""

echo ""
echo "=========================================================================="
echo " build-source.sh"
echo " ${0}"
echo "=========================================================================="
echo ""

echo "app_name: $app_name"
echo "pkg_name: $pkg_name"
# get pkg name from BRANDING.mak
[[ "${BRANDING[SHORTNAME]}" ]] || {
unset BRANDING ;declare -A BRANDING
[[ -s BRANDING.mak ]] && while read k x v ; do
[[ "${k}" =~ ^BRANDING_ ]] && BRANDING[${k#*_}]="${v}"
done < BRANDING.mak
}
[[ "${BRANDING[SHORTNAME]}" ]] || abrt "Missing BRANDING_SHORTNAME (check BRANDING.mak)"

echo "pkg name: ${BRANDING[SHORTNAME]}"
echo "--------------------------------------------------------------------------"

# clean build dir

rm -rfv /tmp/builds
mkdir -pv /tmp/builds

make clean

mkdir -pv release/source

echo "--------------------------------------------------------------------------"

# build source package
dpkg-source --build ./

mv -vf ../$pkg_name*.dsc release/source/
mv -vf ../$pkg_name*.tar.xz release/source/

if [ $? -ne 0 ]; then cd "$backup"; echo "Failed"; exit 1; fi
dpkg-source --build . || abrt
mv -vf ../${BRANDING[SHORTNAME]}*.dsc release/source/ || abrt
mv -vf ../${BRANDING[SHORTNAME]}*.tar.* release/source/ || abrt

echo "--------------------------------------------------------------------------"

# list files
ls -l release/source

echo "-------------------------------------------------------------------------"

cd "$backup"
Loading

0 comments on commit f2f35b3

Please sign in to comment.