4 Komitmen c27dfe1000 ... cf97bffb1e

Pembuat SHA1 Pesan Tanggal
  Dima Krasner cf97bffb1e CI (#13) 6 tahun lalu
  Dima Krasner 098d8073ec Added automatic detection of the last minor kernel version 6 tahun lalu
  Dima Krasner 7b63748b16 Merge pull request #6 from kuleszdl/patch-1 6 tahun lalu
  Daniel Kulesz b1a697aec4 Use defaults in kernel config for any new params 6 tahun lalu
5 mengubah file dengan 164 tambahan dan 104 penghapusan
  1. 32 0
      .travis.yml
  2. 24 0
      Dockerfile
  3. 0 97
      README
  4. 83 0
      README.md
  5. 25 7
      devsus.sh

+ 32 - 0
.travis.yml

@@ -0,0 +1,32 @@
+#  this file is part of Devsus.
+#
+#  Copyright 2018 Dima Krasner
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+#  MA 02110-1301, USA.
+
+language: bash
+
+matrix:
+  include:
+    - os: linux
+      dist: trusty
+
+services:
+  - docker
+
+script:
+  - docker build -t devsus -f Dockerfile .
+  - docker run -e CI -w /root devsus ./devsus.sh

+ 24 - 0
Dockerfile

@@ -0,0 +1,24 @@
+#  this file is part of Devsus.
+#
+#  Copyright 2018 Dima Krasner
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+#  MA 02110-1301, USA.
+
+FROM debian:stretch
+
+RUN apt-get -qq update
+RUN apt-get install -y --no-install-recommends --no-install-suggests ca-certificates gcc libc-dev bc gcc-arm-none-eabi make xz-utils patch device-tree-compiler wget
+ADD . /root

+ 0 - 97
README

@@ -1,97 +0,0 @@
-     _
-  __| | _____   _____ _   _ ___
- / _` |/ _ \ \ / / __| | | / __|
-| (_| |  __/\ V /\__ \ |_| \__ \
- \__,_|\___| \_/ |___/\__,_|___/
-
-Overview
-========
-
-Devsus is a script that builds bootable, libre Devuan (http://www.devuan.org/)
-images for the Asus C201 Chromebook, one of the few laptops able to boot and run
-without any non-free software, all the way down to the firmware level. The C201
-is supported by Libreboot (http://www.libreboot.org/).
-
-The images produced by Devsus contain a Linux-libre
-(http://linux-libre.fsfla.org/) longterm kernel tuned for small size, good
-performance and short boot times.
-
-Some features of the RK3288 SoC, including built-in WiFi support, require use of
-non-free software. Therefore, they are unsupported by Devsus. To compensate for
-that, the Devsus kernel includes support for freedom-friendly devices:
-
-	- Firmware for Atheros AR9271 based WiFi dongles
-	- Drivers for Qualcomm CSR8510 based Bluetooth dongles
-
-Moreover, the Devuan installation is very minimal and consists of a barebones
-Devuan base, plus crucial command-line tools, like those required to connect to
-a WiFi network.
-
-Dependencies
-============
-
-Devsus has been tested on Devuan 2 (ASCII) on x86_64, with the following
-packages installed:
-
-	apt install --no-install-recommends --no-install-suggests \
-		parted cgpt \
-		git gawk device-tree-compiler vboot-kernel-utils gcc-arm-none-eabi \
-			u-boot-tools \
-		gcc make libc-dev wget g++ cmake \
-		binfmt-support qemu-user-static debootstrap \
-		bc wget xz-utils m4
-
-Building
-========
-
-	# ./devsus.sh
-
-This produces two Devuan disk images:
-
-	1) devuan-ascii-c201-libre-16GB.img, a 16 GB image suitable for persistent
-	   installation; its size should be exactly the size of the internal SSD
-	2) devuan-ascii-c201-libre-2GB.img, a 2 GB image suitable for booting the
-	   laptop off USB
-
-Usage
-=====
-
-To produce a bootable media, write the 2 GB image to a flash drive (of at least
-2 GB):
-
-	# dd if=$SOMEWHERE/devuan-ascii-c201-libre-2GB.img of=/dev/$DEVICE bs=50M
-
-The root password is blank.
-
-The 2 GB image (yes, the smaller one) contains the larger, 16 GB one under /.
-This way, it is possible to boot the laptop through USB, then install Devuan
-persistently without having to download or store the large image separately.
-
-Persistent installation is performed using dd, too:
-
-	# dd if=/devuan-ascii-c201-libre-16GB.img of=/dev/mmcblk0
-
-Modifications
-=============
-
-The images produced by Devsus are very close to stock Devuan:
-
-	- APT has been configured not to install "recommended" packages by default
-	- Some critical (like udev) or useful (like iw) packages have been added
-	- unscd has been added, to cache DNS
-	- The number of virtual consoles has been reduced from 6 to 2
-
-Credits and Legal Information
-=============================
-
-Devsus' previous kernel building procedure was based on the linux-veyron package
-of Arch Linux ARM (http://www.archlinuxarm.org/).
-
-Devsus' workaround for ath9k_htc instability issues has been adopted from
-PrawnOS (https://github.com/SolidHal/PrawnOS) and found by SolidHal.
-
-Devsus is free and unencumbered software released under the terms of the GNU
-General Public License, version 2; see COPYING for the license text. For a list
-of its authors and contributors, see AUTHORS.
-
-The ASCII art logo at the top was made using FIGlet (http://www.figlet.org/).

+ 83 - 0
README.md

@@ -0,0 +1,83 @@
+```
+     _
+  __| | _____   _____ _   _ ___
+ / _` |/ _ \ \ / / __| | | / __|
+| (_| |  __/\ V /\__ \ |_| \__ \
+ \__,_|\___| \_/ |___/\__,_|___/
+```
+
+[![Build Status](https://travis-ci.org/dimkr/devsus.svg?branch=master)](https://travis-ci.org/dimkr/devsus)
+
+Overview
+========
+
+Devsus is a script that builds bootable, libre [Devuan](http://www.devuan.org/) images for the Asus C201 Chromebook, one of the few laptops able to boot and run without any non-free software, all the way down to the firmware level. The C201 is supported by [Libreboot](http://www.libreboot.org/).
+
+The images produced by Devsus contain a [Linux-libre](http://linux-libre.fsfla.org/) longterm kernel tuned for small size, good performance and short boot times.
+
+Some features of the Rockchip RK3288 SoC, including built-in WiFi support, require use of non-free software. Therefore, they are unsupported by Devsus. To compensate for that, the Devsus kernel includes support for freedom-friendly devices:
+
+* Firmware for Atheros AR9271 based WiFi dongles
+* Drivers for Qualcomm CSR8510 based Bluetooth dongles
+
+Moreover, the Devuan installation is very minimal and consists of a barebones Devuan base, plus crucial command-line tools, like those required to connect to a WiFi network.
+
+Dependencies
+============
+
+Devsus has been tested on Devuan 2 (ASCII) on x86_64, with the following packages installed:
+
+	apt install --no-install-recommends --no-install-suggests \
+		parted cgpt \
+		git gawk device-tree-compiler vboot-kernel-utils gcc-arm-none-eabi \
+			u-boot-tools \
+		gcc make libc-dev wget g++ cmake \
+		binfmt-support qemu-user-static debootstrap \
+		bc wget xz-utils m4 patch
+
+Building
+========
+
+	# ./devsus.sh
+
+This produces two Devuan disk images:
+
+1. devuan-ascii-c201-libre-16GB.img, a 16 GB image suitable for persistent installation; its size should be exactly the size of the internal SSD
+2. devuan-ascii-c201-libre-2GB.img, a 2 GB image suitable for booting the laptop off USB
+
+Usage
+=====
+
+To produce a bootable media, write the 2 GB image to a flash drive (of at least 2 GB):
+
+	# dd if=$SOMEWHERE/devuan-ascii-c201-libre-2GB.img of=/dev/$DEVICE bs=50M
+
+The root password is blank.
+
+The 2 GB image (yes, the smaller one) contains the larger, 16 GB one under /. This way, it is possible to boot the laptop through USB, then install Devuan persistently without having to download or store the large image separately.
+
+Persistent installation is performed using dd, too:
+
+	# dd if=/devuan-ascii-c201-libre-16GB.img of=/dev/mmcblk0
+
+Modifications
+=============
+
+The images produced by Devsus are very close to stock Devuan:
+
+* APT has been configured not to install "recommended" packages by default
+* Some critical (like udev) or useful (like iw) packages have been added
+* unscd has been added, to cache DNS
+* The number of virtual consoles has been reduced from 6 to 2
+
+Credits and Legal Information
+=============================
+
+Devsus' previous kernel building procedure was based on the linux-veyron package
+of [Arch Linux ARM](http://www.archlinuxarm.org/).
+
+Devsus' workaround for ath9k_htc instability issues has been adopted from [PrawnOS](https://github.com/SolidHal/PrawnOS) and found by SolidHal.
+
+Devsus is free and unencumbered software released under the terms of the GNU General Public License, version 2; see COPYING for the license text. For a list of its authors and contributors, see AUTHORS.
+
+The ASCII art logo at the top was made using [FIGlet](http://www.figlet.org/).

+ 25 - 7
devsus.sh

@@ -19,7 +19,7 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 #  MA 02110-1301, USA.
 
-KVER=4.9.127
+KVER=4.9
 
 outmnt=$(mktemp -d -p `pwd`)
 inmnt=$(mktemp -d -p `pwd`)
@@ -39,13 +39,18 @@ cleanup() {
 	losetup -d $outdev > /dev/null 2>&1
 }
 
-trap cleanup INT TERM EXIT
+[ "$CI" != true ] && trap cleanup INT TERM EXIT
+
+minor=`wget -q -O- http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.N/ | grep -F patch-$KVER-gnu | head -n 1 | cut -f 9 -d . | cut -f 1 -d -`
+[ ! -f linux-libre-$KVER-gnu.tar.xz ] && wget http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-4.9.0/linux-libre-$KVER-gnu.tar.xz
+[ ! -f patch-$KVER-gnu-$KVER.$minor-gnu ] && wget -O- https://www.linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-$KVER.N/patch-$KVER-gnu-$KVER.$minor-gnu.xz | xz -d > patch-$KVER-gnu-$KVER.$minor-gnu
+[ ! -f ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch ] && wget -O ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=2b721118b7821107757eb1d37af4b60e877b27e7
+[ ! -d open-ath9k-htc-firmware ] && git clone --depth 1 https://github.com/qca/open-ath9k-htc-firmware.git
 
 # build Linux-libre
-[ ! -f linux-libre-$KVER-gnu.tar.xz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.xz
 [ ! -d linux-$KVER ] && tar -xJf linux-libre-$KVER-gnu.tar.xz
-[ ! -f ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch ] && wget -O ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=2b721118b7821107757eb1d37af4b60e877b27e7
 cd linux-$KVER
+patch -p 1 < ../patch-$KVER-gnu-$KVER.$minor-gnu
 make clean
 make mrproper
 # work around instability of ath9k_htc, see https://github.com/SolidHal/PrawnOS/issues/38
@@ -53,8 +58,22 @@ patch -R -p 1 < ../ath9k_htc_do_not_use_bulk_on_ep3_and_ep4.patch
 # reset the minor version number, so out-of-tree drivers continue to work after
 # a kernel upgrade
 sed s/'SUBLEVEL = .*'/'SUBLEVEL = 0'/ -i Makefile
-cp ../config .config
-make -j `grep ^processor /proc/cpuinfo  | wc -l` CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
+cp -f ../config .config
+
+kmake="make -j `grep ^processor /proc/cpuinfo  | wc -l` CROSS_COMPILE=arm-none-eabi- ARCH=arm"
+
+$kmake olddefconfig
+$kmake modules_prepare
+$kmake SUBDIRS=drivers/usb/dwc2 modules
+$kmake SUBDIRS=drivers/net/wireless/ath/ath9k modules
+$kmake SUBDIRS=drivers/bluetooth modules
+$kmake dtbs
+
+# CI flow ends here
+[ "$CI" = true ] && exit 0
+
+$kmake zImage modules
+
 [ ! -h kernel.its ] && ln -s ../kernel.its .
 mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
 dd if=/dev/zero of=bootloader.bin bs=512 count=1
@@ -69,7 +88,6 @@ vbutil_kernel --pack vmlinux.kpart \
 cd ..
 
 # build AR9271 firmware
-[ ! -d open-ath9k-htc-firmware ] && git clone --depth 1 https://github.com/qca/open-ath9k-htc-firmware.git
 cd open-ath9k-htc-firmware
 make toolchain
 make -C target_firmware