├── .gitmodules ├── Android └── android_hybris │ ├── Android.mk │ ├── packaging │ ├── archlinux │ │ ├── dhcp-4.3.3.p1-1-armv7h.pkg.tar.xz │ │ ├── hybris-usb-0.1-2-armv7h.pkg.tar.xz │ │ ├── ota.mk │ │ └── postinstall.sh │ ├── chroot.sh │ ├── extract-headers.sh │ ├── extract.sh │ └── ota.mk │ └── ramdisk │ ├── CleanSpec.mk │ ├── hybris-ramdisk.mk │ ├── init.profile │ └── initramfs │ ├── bin │ └── sh │ ├── init │ ├── sbin │ └── usr │ ├── bin │ └── sbin ├── Docs ├── architecture.svg ├── archlinux.md ├── main.md └── res │ └── architecture.png ├── GNULinux └── Archlinux │ └── PKGBUILDs │ ├── hybris-android-headers │ └── PKGBUILD │ ├── hybris-device-sony-nozomi │ ├── 602-nozomi-extra.rules │ ├── PKGBUILD │ ├── default.hybris-device │ ├── generate-android-udev-rules.sh │ ├── generate-android-users.sh │ ├── hybris-device.install │ ├── hybris-device.install.template │ └── profile.hybris-device.sh │ ├── hybris-linux-sony-nozomi │ └── PKGBUILD │ ├── hybris-ready │ ├── PKGBUILD │ └── hybris-ready.install │ ├── hybris-usb │ ├── PKGBUILD │ ├── dhcpd.conf │ ├── dhcpd4.service-customexec.conf │ ├── tmpfiles.d.hybris-usb.conf │ ├── usb-tethering │ └── usb-tethering.service │ ├── kwin-hybris │ ├── PKGBUILD │ └── kwin.install │ ├── libhybris-ext-git │ └── PKGBUILD │ ├── libhybris-git │ └── PKGBUILD │ ├── mesa-hybris │ ├── 0001-EGL-Implement-the-libglvnd-interface-for-EGL-v2.patch │ ├── 0001-Fix-linkage-against-shared-glapi.patch │ ├── 0001-glapi-Link-with-glapi-when-built-shared.patch │ ├── 0002-fixup-EGL-Implement-the-libglvnd-interface-for-EGL-v.patch │ ├── LICENSE │ ├── PKGBUILD │ ├── glvnd-fix-gl-dot-pc.patch │ └── remove-libpthread-stubs.patch │ ├── qt5-qpa-hwcomposer-plugin │ └── PKGBUILD │ ├── qt5-qpa-surfaceflinger-plugin │ └── PKGBUILD │ ├── schroot-hybris │ ├── PKGBUILD │ ├── android-environment-schroot.patch │ ├── arch32-config │ ├── arch32-copyfiles │ ├── arch32-example │ ├── arch32-mount │ ├── arch32-nssdatabases │ ├── fix-bash-completion.patch │ └── pam.d.schroot.patch │ └── systemd-legacy │ ├── 0001-Revert-nspawn-try-to-bind-mount-resolved-s-resolv.co.patch │ ├── 0001-disable-RestrictAddressFamilies-on-i686.patch │ ├── 0001-nspawn-don-t-hide-bind-tmp-mounts.patch │ ├── PKGBUILD │ ├── arch.conf │ ├── initcpio-hook-udev │ ├── initcpio-install-systemd │ ├── initcpio-install-udev │ ├── loader.conf │ ├── splash-arch.bmp │ ├── systemd-hwdb.hook │ ├── systemd-sysusers.hook │ ├── systemd-tmpfiles.hook │ ├── systemd-update.hook │ ├── systemd-user.pam │ ├── systemd.install │ └── userspace-firmware-loading-support.patch └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "GNULinux/kernel-check"] 2 | path = GNULinux/kernel-check 3 | url = https://github.com/mer-hybris/mer-kernel-check 4 | [submodule "Android/android_hybris/libhybris"] 5 | path = Android/android_hybris/libhybris 6 | url = https://github.com/mickybart/libhybris_ext 7 | -------------------------------------------------------------------------------- /Android/android_hybris/Android.mk: -------------------------------------------------------------------------------- 1 | ifeq ($(GNULINUX_SUPPORT),true) 2 | #include $(all-subdir-makefiles) 3 | MY_LOCAL_PATH := $(call my-dir) 4 | 5 | include $(MY_LOCAL_PATH)/libhybris/compat/surface_flinger/Android.mk 6 | include $(MY_LOCAL_PATH)/libhybris/compat/ui/Android.mk 7 | 8 | endif 9 | -------------------------------------------------------------------------------- /Android/android_hybris/packaging/archlinux/dhcp-4.3.3.p1-1-armv7h.pkg.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mickybart/gnulinux_support/86ef8f30156a4c36780ccc2501a0879301002205/Android/android_hybris/packaging/archlinux/dhcp-4.3.3.p1-1-armv7h.pkg.tar.xz -------------------------------------------------------------------------------- /Android/android_hybris/packaging/archlinux/hybris-usb-0.1-2-armv7h.pkg.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mickybart/gnulinux_support/86ef8f30156a4c36780ccc2501a0879301002205/Android/android_hybris/packaging/archlinux/hybris-usb-0.1-2-armv7h.pkg.tar.xz -------------------------------------------------------------------------------- /Android/android_hybris/packaging/archlinux/ota.mk: -------------------------------------------------------------------------------- 1 | 2 | GNULINUX_SYSTEM_IMAGE_FILE := ArchLinuxARM-$(GNULINUX_OTA_ARCH)-latest.tar.gz 3 | GNULINUX_SYSTEM_IMAGE_URL := https://archlinuxarm.org/os/$(GNULINUX_SYSTEM_IMAGE_FILE) 4 | 5 | GNULINUX_CHROOT_INCLUDE_FILES := "*-$(GNULINUX_OTA_ARCH)*.xz" 6 | 7 | -------------------------------------------------------------------------------- /Android/android_hybris/packaging/archlinux/postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #Files extracted by chroot.sh are in this path 4 | CHROOT_FILES_PATH=/tmp/gnulinux-chroot 5 | 6 | pacman -Rcs --noconfirm $(pacman -Qo /boot/zImage | cut -d' ' -f5) linux-firmware mkinitcpio 7 | pacman -U --noconfirm ${CHROOT_FILES_PATH}/hybris/packaging/archlinux/*.pkg.tar.xz 8 | 9 | ln -s /usr/lib/systemd/system/usb-tethering.service /etc/systemd/system/multi-user.target.wants/ 10 | 11 | groupmod -g 100000 alarm 12 | usermod -g 100000 -u 100000 alarm 13 | chgrp -R alarm /home/alarm/ 14 | 15 | -------------------------------------------------------------------------------- /Android/android_hybris/packaging/chroot.sh: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | CHROOT_FILE=/tmp/gnulinux-chroot.tgz 4 | CHROOT_FILES_PATH=/tmp/gnulinux-chroot 5 | ROOTFS=/data/media/_gnulinux 6 | 7 | [ ! -d $ROOTFS ] && exit 1 8 | 9 | mkdir -p ${CHROOT_FILES_PATH} 10 | tar -xzf $CHROOT_FILE -C ${CHROOT_FILES_PATH} || exit 2 11 | 12 | mount --bind /dev $ROOTFS/dev 13 | mount --bind /proc $ROOTFS/proc 14 | mount --bind /sys $ROOTFS/sys 15 | mount --bind /tmp $ROOTFS/tmp 16 | 17 | chroot $ROOTFS /bin/sh ${CHROOT_FILES_PATH}/hybris/packaging/*/postinstall.sh 18 | ERROR=$? 19 | 20 | umount $ROOTFS/tmp 21 | umount $ROOTFS/proc 22 | umount $ROOTFS/dev 23 | umount $ROOTFS/sys 24 | 25 | rm -rf ${CHROOT_FILES_PATH} 26 | rm $CHROOT_FILE 27 | 28 | exit $ERROR 29 | 30 | -------------------------------------------------------------------------------- /Android/android_hybris/packaging/extract-headers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ANDROID_ROOT=$1 4 | HEADERPATH=$2 5 | MAJOR=$3 6 | MINOR=$4 7 | 8 | PATCH=$5 9 | PATCH2=$6 10 | PATCH3=$7 11 | 12 | usage() { 13 | echo "Usage: extract-headers.sh [Android Platform Version]" 14 | echo 15 | echo " ANDROID_ROOT: Directory containing the Android source tree." 16 | echo " HEADER_PATH: Where the headers will be extracted to." 17 | echo 18 | echo "Android Platform Version:" 19 | echo " This field is optional. If not specified, automatic extraction is attempted." 20 | echo 21 | echo "Ex:" 22 | echo " ./extract-headers.sh android-aosp/ /tmp/android-headers/ 4 2 2" 23 | 24 | } 25 | 26 | if [ x$ANDROID_ROOT = x -o "x$HEADERPATH" = x ]; then 27 | usage 28 | exit 1 29 | fi 30 | 31 | 32 | if [ x$MAJOR = x -o x$MINOR = x -o x$PATCH = x ]; then 33 | VERSION_DEFAULTS=$ANDROID_ROOT/build/core/version_defaults.mk 34 | 35 | parse_defaults_failed() { 36 | echo "Error: Cannot read PLATFORM_VERSION from ${VERSION_DEFAULTS}." 37 | echo "Please specify MAJOR, MINOR and PATCH manually to continue." 38 | exit 1 39 | } 40 | 41 | if [ ! -f $VERSION_DEFAULTS ]; then 42 | parse_defaults_failed 43 | fi 44 | 45 | IFS="." read MAJOR MINOR PATCH PATCH2 PATCH3 < [FILE|DIR] ... 75 | # For each FILE argument, copy it to TARGET 76 | # For each DIR argument, copy all its contents to TARGET 77 | TARGET_DIRECTORY=$HEADERPATH/$1 78 | echo " $1" 79 | shift 80 | 81 | while [ $# -gt 0 ]; do 82 | SOURCE_PATH=$ANDROID_ROOT/$1 83 | if [ -d $SOURCE_PATH ]; then 84 | for file in $SOURCE_PATH/*.h; do 85 | echo " $1/$(basename $file)" 86 | mkdir -p $TARGET_DIRECTORY 87 | cp $file $TARGET_DIRECTORY/ 88 | done 89 | elif [ -f $SOURCE_PATH ]; then 90 | echo " $1" 91 | mkdir -p $TARGET_DIRECTORY 92 | cp $SOURCE_PATH $TARGET_DIRECTORY/ 93 | else 94 | echo "Missing file: $1" 95 | fi 96 | shift 97 | done 98 | } 99 | 100 | 101 | # Make sure that the dir given contains at least some of the assumed structures. 102 | require_sources \ 103 | hardware/libhardware/include/hardware 104 | 105 | mkdir -p $HEADERPATH 106 | 107 | # Default PATCH2,3 to 0 108 | PATCH2=${PATCH2:-0} 109 | PATCH3=${PATCH3:-0} 110 | 111 | cat > $HEADERPATH/android-version.h << EOF 112 | #ifndef ANDROID_VERSION_H_ 113 | #define ANDROID_VERSION_H_ 114 | 115 | #define ANDROID_VERSION_MAJOR $MAJOR 116 | #define ANDROID_VERSION_MINOR $MINOR 117 | #define ANDROID_VERSION_PATCH $PATCH 118 | #define ANDROID_VERSION_PATCH2 $PATCH2 119 | #define ANDROID_VERSION_PATCH3 $PATCH3 120 | 121 | #endif 122 | EOF 123 | 124 | cat > $HEADERPATH/android-config.h << EOF 125 | #ifndef HYBRIS_CONFIG_H_ 126 | #define HYBRIS_CONFIG_H_ 127 | 128 | /* When android is built for a specific device the build is 129 | modified by BoardConfig.mk and possibly other mechanisms. 130 | eg 131 | device/samsung/i9305/BoardConfig.mk: 132 | COMMON_GLOBAL_CFLAGS += -DCAMERA_WITH_CITYID_PARAM 133 | device/samsung/smdk4412-common/BoardCommonConfig.mk: 134 | COMMON_GLOBAL_CFLAGS += -DEXYNOS4_ENHANCEMENTS 135 | 136 | This file allows those global configurations, which are not 137 | otherwise defined in the build headers, to be available in 138 | hybris builds. 139 | 140 | Typically it is generated at hardware adaptation time. 141 | 142 | The CONFIG GOES HERE line can be used by automation to modify 143 | this file. 144 | */ 145 | 146 | #include 147 | 148 | /* CONFIG GOES HERE */ 149 | 150 | #endif 151 | EOF 152 | 153 | cat > $HEADERPATH/android-headers.pc <<'EOF' 154 | Name: Android header files 155 | Description: Header files needed to write applications for the Android platform 156 | Version: androidversion 157 | 158 | prefix=/usr 159 | exec_prefix=${prefix} 160 | includedir=${prefix}/include 161 | 162 | Cflags: -I${includedir}/android 163 | EOF 164 | 165 | sed -i -e s:androidversion:$MAJOR.$MINOR.$PATCH:g $HEADERPATH/android-headers.pc 166 | 167 | extract_headers_to hardware \ 168 | hardware/libhardware/include/hardware 169 | 170 | extract_headers_to hardware_legacy \ 171 | hardware/libhardware_legacy/include/hardware_legacy/vibrator.h 172 | if [ $MAJOR -ge 4 -a $MINOR -ge 1 -o $MAJOR -ge 5 ]; then 173 | extract_headers_to hardware_legacy \ 174 | hardware/libhardware_legacy/include/hardware_legacy/audio_policy_conf.h \ 175 | hardware/libhardware_legacy/include/hardware_legacy/wifi.h 176 | fi 177 | 178 | if [ $MAJOR -ge 6 ]; then 179 | extract_headers_to system \ 180 | system/media/audio/include/system/audio.h 181 | fi 182 | 183 | extract_headers_to cutils \ 184 | system/core/include/cutils 185 | 186 | if [ $MAJOR -eq 4 -a $MINOR -ge 4 -o $MAJOR -ge 5 ]; then 187 | extract_headers_to log \ 188 | system/core/include/log 189 | fi 190 | 191 | if [ $MAJOR -ge 4 ]; then 192 | extract_headers_to system \ 193 | system/core/include/system 194 | fi 195 | 196 | extract_headers_to android \ 197 | system/core/include/android 198 | 199 | if [ $MAJOR -eq 4 -a $MINOR -ge 1 ]; then 200 | extract_headers_to linux \ 201 | bionic/libc/kernel/common/linux/sync.h \ 202 | bionic/libc/kernel/common/linux/sw_sync.h 203 | 204 | extract_headers_to sync \ 205 | system/core/include/sync 206 | elif [ $MAJOR -ge 5 ]; then 207 | extract_headers_to linux \ 208 | bionic/libc/kernel/uapi/linux/sync.h \ 209 | bionic/libc/kernel/uapi/linux/sw_sync.h 210 | 211 | extract_headers_to sync \ 212 | system/core/libsync/include/sync 213 | fi 214 | 215 | if [ $MAJOR -eq 2 -a $MINOR -ge 3 -o $MAJOR -ge 3 ]; then 216 | extract_headers_to libnfc-nxp \ 217 | external/libnfc-nxp/inc \ 218 | external/libnfc-nxp/src 219 | fi 220 | 221 | extract_headers_to private \ 222 | system/core/include/private/android_filesystem_config.h 223 | 224 | if [ $MAJOR -ge 5 ]; then 225 | extract_headers_to linux \ 226 | bionic/libc/kernel/uapi/linux/android_alarm.h \ 227 | bionic/libc/kernel/uapi/linux/binder.h 228 | elif [ $MAJOR -eq 2 -a $MINOR -ge 2 -o $MAJOR -ge 3 ]; then 229 | extract_headers_to linux \ 230 | external/kernel-headers/original/linux/android_alarm.h \ 231 | external/kernel-headers/original/linux/binder.h 232 | else 233 | extract_headers_to linux \ 234 | bionic/libc/kernel/common/linux/android_alarm.h \ 235 | bionic/libc/kernel/common/linux/binder.h 236 | fi 237 | 238 | # In order to make it easier to trace back the origins of headers, fetch 239 | # some repository information from the Git source tree (if available). 240 | # Tested with AOSP and CM. 241 | NOW=$(LC_ALL=C date) 242 | 243 | # Add here all sub-projects of AOSP/CM from which headers are extracted 244 | GIT_PROJECTS=" 245 | hardware/libhardware 246 | hardware/libhardware_legacy 247 | system/core 248 | external/libnfc-nxp 249 | external/linux-headers 250 | " 251 | 252 | echo "Extracting Git revision information" 253 | rm -f $HEADERPATH/SOURCE_GIT_REVISION_INFO 254 | (for GIT_PROJECT in $GIT_PROJECTS; do 255 | TARGET_DIR=$ANDROID_ROOT/$GIT_PROJECT 256 | echo "================================================" 257 | echo "$GIT_PROJECT @ $NOW" 258 | echo "================================================" 259 | if [ -e $TARGET_DIR/.git ]; then 260 | ( 261 | set -x 262 | cd $ANDROID_ROOT 263 | repo status $GIT_PROJECT 264 | cd $TARGET_DIR 265 | git show-ref --head 266 | git remote -v 267 | ) 268 | echo "" 269 | echo "" 270 | else 271 | echo "WARNING: $GIT_PROJECT does not contain a Git repository" 272 | fi 273 | done) > $HEADERPATH/git-revisions.txt 2>&1 274 | 275 | # Repo manifest that can be used to fetch the sources for re-extracting headers 276 | if [ -e $ANDROID_ROOT/.repo/manifest.xml ]; then 277 | cp $ANDROID_ROOT/.repo/manifest.xml $HEADERPATH/ 278 | fi 279 | 280 | # Add a makefile to make packaging easier 281 | cat > ${HEADERPATH}/Makefile << EOF 282 | PREFIX?=/usr/local 283 | INCLUDEDIR?=\$(PREFIX)/include/android 284 | PKGCONFIGDIR?=\$(PREFIX)/lib/pkgconfig 285 | all: 286 | @echo "Use '\$(MAKE) install' to install" 287 | 288 | install: 289 | mkdir -p \$(DESTDIR)/\$(INCLUDEDIR) 290 | mkdir -p \$(DESTDIR)/\$(PKGCONFIGDIR) 291 | cp android-config.h android-version.h \$(DESTDIR)/\$(INCLUDEDIR) 292 | cp android-headers.pc \$(DESTDIR)/\$(PKGCONFIGDIR) 293 | sed -i -e s:prefix=/usr:prefix=\$(PREFIX):g \$(DESTDIR)/\$(PKGCONFIGDIR)/android-headers.pc 294 | cp -r hardware \$(DESTDIR)/\$(INCLUDEDIR) 295 | cp -r hardware_legacy \$(DESTDIR)/\$(INCLUDEDIR) 296 | cp -r cutils \$(DESTDIR)/\$(INCLUDEDIR) 297 | cp -r system \$(DESTDIR)/\$(INCLUDEDIR) 298 | cp -r android \$(DESTDIR)/\$(INCLUDEDIR) 299 | cp -r linux \$(DESTDIR)/\$(INCLUDEDIR) 300 | cp -r sync \$(DESTDIR)/\$(INCLUDEDIR) 301 | cp -r libnfc-nxp \$(DESTDIR)/\$(INCLUDEDIR) 302 | cp -r private \$(DESTDIR)/\$(INCLUDEDIR) 303 | cp -r log \$(DESTDIR)/\$(INCLUDEDIR) 304 | EOF 305 | 306 | find "$HEADERPATH" -type f -exec chmod 0644 {} \; 307 | 308 | exit 0 309 | # vim: noai:ts=4:sw=4:ss=4:expandtab 310 | -------------------------------------------------------------------------------- /Android/android_hybris/packaging/extract.sh: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | IMAGE=/data/gnulinux.tgz 4 | DESTINATION=/data/media/_gnulinux 5 | 6 | if [ -d $DESTINATION ]; then 7 | mv $DESTINATION $DESTINATION-$(date '+%s') 8 | fi 9 | 10 | mkdir -p $DESTINATION 11 | tar --numeric-owner -xzf $IMAGE -C $DESTINATION 12 | ERROR=$? 13 | 14 | rm $IMAGE 15 | 16 | exit $ERROR 17 | 18 | -------------------------------------------------------------------------------- /Android/android_hybris/packaging/ota.mk: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------- 2 | # OTA hybris files for GNU/Linux 3 | # 4 | # hybris-device.tgz : 5 | # Provide: 6 | # /system 7 | # root (boot ramdisk) 8 | # headers (at least for libhybris compilation) 9 | # boot.img (kernel + hyrbis ramdisk) 10 | # 11 | # hybris-linux.tgz : 12 | # Provide: 13 | # boot.img (with hybris ramdisk) 14 | 15 | .PHONY: hybris 16 | hybris: hybris-device hybris-linux 17 | 18 | hybris-device: $(DEFAULT_GOAL) $(BUILT_RAMDISK_TARGET) 19 | $(call pretty,"Creating headers") 20 | $(hide) rm -rf $(PRODUCT_OUT)/headers 21 | $(hide) ./hybris/packaging/extract-headers.sh $(TOP) $(PRODUCT_OUT)/headers $(shell (echo $(PLATFORM_VERSION) | tr '.' ' ')) 22 | $(call pretty,"Creating package: $@.tgz") 23 | $(hide) rm -f $(PRODUCT_OUT)/$@.tgz 24 | $(hide) tar -czf $(PRODUCT_OUT)/$@.tgz $(PRODUCT_OUT)/system $(PRODUCT_OUT)/headers $(PRODUCT_OUT)/root 25 | $(call pretty,"Package created: $@.tgz") 26 | 27 | hybris-linux: $(INSTALLED_BOOTIMAGE_TARGET) 28 | $(call pretty,"Creating package: $@.tgz") 29 | $(hide) rm -f $(PRODUCT_OUT)/$@.tgz 30 | $(hide) tar -czf $(PRODUCT_OUT)/$@.tgz $(INSTALLED_BOOTIMAGE_TARGET) 31 | $(call pretty,"Package created: $@.tgz") 32 | 33 | # ----------------------------------------------------------------- 34 | # OTA Package for GNU/Linux 35 | 36 | ifeq ($(GNULINUX_OTA_OS),) 37 | $(error No GNULINUX_OTA_OS defined - eg: archlinux.) 38 | endif 39 | ifeq ($(GNULINUX_OTA_ARCH),) 40 | $(error No GNULINUX_OTA_ARCH defined - eg: armv7) 41 | endif 42 | 43 | include ./hybris/packaging/$(GNULINUX_OTA_OS)/ota.mk 44 | 45 | GNULINUX_SYSTEM_IMAGE_OUT := $(PRODUCT_OUT)/$(GNULINUX_SYSTEM_IMAGE_FILE) 46 | GNULINUX_CHROOT_IMAGE_OUT := $(PRODUCT_OUT)/gnulinux-chroot.tgz 47 | 48 | GNULINUX_CHROOT_EXTRA_FILES := $(shell (ls -1 "./hybris/packaging/$(GNULINUX_OTA_OS)/$(GNULINUX_CHROOT_INCLUDE_FILES)" | tr '\n' ' ')) ./hybris/packaging/$(GNULINUX_OTA_OS)/postinstall.sh 49 | 50 | $(GNULINUX_CHROOT_IMAGE_OUT): $(GNULINUX_CHROOT_EXTRA_FILES) 51 | @echo "Package chroot postinstall: $@" 52 | $(hide) tar -czf $@ $(GNULINUX_CHROOT_EXTRA_FILES) 53 | 54 | $(GNULINUX_SYSTEM_IMAGE_OUT): 55 | @echo "Downloading GNU/Linux Image: $@" 56 | curl -L $(GNULINUX_SYSTEM_IMAGE_URL) -o $@ 57 | 58 | ifndef BOARD_CUSTOM_GNULINUX_OTA_MK 59 | INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(GNULINUX_OTA_OS)-$(GNULINUX_OTA_ARCH)-$(TARGET_DEVICE).zip 60 | 61 | $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) 62 | 63 | $(INTERNAL_OTA_PACKAGE_TARGET): $(DISTTOOLS) $(BUILT_TARGET_FILES_PACKAGE) $(GNULINUX_SYSTEM_IMAGE_OUT) $(GNULINUX_CHROOT_IMAGE_OUT) 64 | @echo "Package GNU/Linux OTA: $@" 65 | MKBOOTIMG=$(MKBOOTIMG) \ 66 | ./build/tools/releasetools/ota_from_target_files -v \ 67 | -p $(HOST_OUT) \ 68 | -k $(KEY_CERT_PAIR) \ 69 | -n \ 70 | --gnulinux \ 71 | --gnulinux_os=$(GNULINUX_OTA_OS) \ 72 | --gnulinux_chroot="$(GNULINUX_CHROOT_IMAGE_OUT)" \ 73 | --gnulinux_image=$(GNULINUX_SYSTEM_IMAGE_OUT) \ 74 | $(BUILT_TARGET_FILES_PACKAGE) $@ 75 | else 76 | include $(BOARD_CUSTOM_GNULINUX_OTA_MK) 77 | endif #BOARD_CUSTOM_GNULINUX_OTA_MK 78 | 79 | -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/CleanSpec.mk: -------------------------------------------------------------------------------- 1 | $(call add-clean-step, rm -rf $(PRODUCT_OUT)/hybris-root) 2 | $(call add-clean-step, rm -rf $(PRODUCT_OUT)/ramdisk.img) 3 | 4 | -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/hybris-ramdisk.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2016 Michael Serpieri 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # ----------------------------------------------------------------- 18 | # env 19 | HYBRIS_TARGET_ROOT_OUT := $(PRODUCT_OUT)/hybris-root 20 | HYBRIS_BUSYBOX := $(PRODUCT_OUT)/utilities/busybox 21 | HYBRIS_RAMDISK_SRC := hybris/ramdisk/initramfs 22 | 23 | ifeq ($(BOARD_HYBRIS_RAMDISK_INIT_PROFILE),) 24 | $(error No BOARD_HYBRIS_RAMDISK_INIT_PROFILE defined. You need to provide a custom file! See hybris/ramdisk/init.profile example) 25 | endif 26 | 27 | ifeq ($(BOARD_HYBRIS_RAMDISK_EXTRA_FILES),) 28 | #Can be defined into BoardConfig.mk to add extra files into ramdisk 29 | BOARD_HYBRIS_RAMDISK_EXTRA_FILES := 30 | endif 31 | 32 | # ----------------------------------------------------------------- 33 | # the ramdisk 34 | INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \ 35 | $(ALL_PREBUILT) \ 36 | $(ALL_COPIED_HEADERS) \ 37 | $(ALL_GENERATED_SOURCES) \ 38 | $(ALL_DEFAULT_INSTALLED_MODULES)) \ 39 | $(HYBRIS_BUSYBOX) \ 40 | $(BOARD_HYBRIS_RAMDISK_INIT_PROFILE) 41 | 42 | BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img 43 | 44 | # We just build this directly to the install location. 45 | INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET) 46 | 47 | $(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) | $(MINIGZIP) 48 | $(call pretty,"Target hybris ram disk: $@") 49 | $(hide) rm -rf $(HYBRIS_TARGET_ROOT_OUT) 50 | $(hide) mkdir -p $(HYBRIS_TARGET_ROOT_OUT) 51 | $(hide) cp -a $(HYBRIS_RAMDISK_SRC)/* $(HYBRIS_TARGET_ROOT_OUT)/ 52 | $(hide) cp -a $(HYBRIS_BUSYBOX) $(HYBRIS_TARGET_ROOT_OUT)/bin/ 53 | $(hide) cp -a $(BOARD_HYBRIS_RAMDISK_INIT_PROFILE) $(HYBRIS_TARGET_ROOT_OUT)/init.profile 54 | $(hide) $(foreach item,$(BOARD_HYBRIS_RAMDISK_EXTRA_FILES), \ 55 | [ "$(item)" != "" ] && cp -af $(item) $(HYBRIS_TARGET_ROOT_OUT)/;) 56 | $(hide) $(MKBOOTFS) $(HYBRIS_TARGET_ROOT_OUT) | $(MINIGZIP) > $@ 57 | 58 | -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/init.profile: -------------------------------------------------------------------------------- 1 | #### 2 | # USB 3 | # Those information can be found into /init..usb.rc file 4 | 5 | USB_IDVENDOR=0fce 6 | USB_IDPRODUCT=7169 7 | USB_IPRODUCT="Xperia S" 8 | USB_ISERIAL="CB511W1UFR" 9 | 10 | #### 11 | # /Data 12 | # 13 | # The system will be installed into the well known Android partition /data 14 | # 15 | # How to determine the device name : 16 | # Search the /data partition name (under Android look into the file /fstab.) 17 | # 18 | # eg : /dev/block/platform/msm_sdcc.1/by-num/p14 /data [...] 19 | # 20 | # Than run under Android: 21 | # ls -l /dev/block/platform/msm_sdcc.1/by-num/p14 22 | # (output will look like: [...] p14 -> /dev/block/mmcblk0p14) 23 | # 24 | # Now run 'cat /proc/partition' and you should see mmcblk0p14 (without /dev/block) 25 | # So mmcblk0p14 is the name to set into DATA_DEVICE 26 | # 27 | # IMPORTANT: mmcblk0p14 is just an example. Replace with your value 28 | # 29 | DATA_DEVICE="mmcblk0p14" 30 | 31 | #### 32 | # Leds 33 | # 34 | # Brightness file of the red notification led. 35 | # Will be used if the boot failed. 36 | # This is NOT mandatory. 37 | #NOTIFICATION_RED_LEDS=/sys/class/leds/red/brightness 38 | 39 | #### 40 | # Possible override but should not be used 41 | # 42 | #Network interface used to set the ip (10.15.19.82) in case of an issue during boot 43 | #(by default we will only try with usb0 or rndis0) 44 | #USB_IFACE= 45 | # 46 | #Telnet port during early boot failure 47 | #TELNET_PORT=23 48 | # 49 | #Location of the OS under /data 50 | #DATA_ROOTFS=/data/media/_gnulinux/ 51 | # 52 | #USB Manufacturer during early boot 53 | #USB_IMANUFACTURER="GNU/Linux Device" 54 | # 55 | # see /init script for more details 56 | -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/initramfs/bin/sh: -------------------------------------------------------------------------------- 1 | busybox -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/initramfs/init: -------------------------------------------------------------------------------- 1 | #!/bin/busybox sh 2 | # 3 | # Copyright (c) 2016 Michael Serpieri 4 | # 5 | # This program is free software; you can redistribute it and/or modify it under 6 | # the terms of the GNU General Public License version 2 as published by the 7 | # Free Software Foundation. 8 | # 9 | 10 | #### 11 | # Prepare environment 12 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin 13 | /bin/busybox --install -s 14 | 15 | LOG=/diagnosis.log 16 | > $LOG 17 | 18 | #### 19 | # Default profile 20 | USB_IDVENDOR=0fce 21 | USB_IDPRODUCT=7169 22 | USB_IPRODUCT="Unknown" 23 | USB_ISERIAL="Unknown" 24 | USB_IMANUFACTURER="GNU/Linux Device" 25 | USB_IFACE="" 26 | TELNET_PORT=23 27 | DATA_ROOTFS=/data/media/_gnulinux 28 | 29 | #### 30 | # Override profile 31 | if [ -f /init.profile ]; then 32 | source /init.profile 33 | fi 34 | 35 | #### 36 | # Constants 37 | ANDROID_USB=/sys/class/android_usb/android0 38 | USB_FUNCTIONS=rndis 39 | LOCAL_IP=10.15.19.82 40 | 41 | write() { 42 | echo -n "$2" > "$1" 43 | } 44 | 45 | usb_setup() { 46 | write $ANDROID_USB/enable 0 47 | write $ANDROID_USB/idVendor $USB_IDVENDOR 48 | write $ANDROID_USB/idProduct $USB_IDPRODUCT 49 | write $ANDROID_USB/iManufacturer "$USB_IMANUFACTURER" 50 | write $ANDROID_USB/iProduct "$USB_IPRODUCT" 51 | write $ANDROID_USB/iSerial "$USB_ISERIAL" 52 | write $ANDROID_USB/functions $USB_FUNCTIONS 53 | write $ANDROID_USB/enable 1 54 | } 55 | 56 | usb_info() { 57 | write $ANDROID_USB/iSerial "$1" 58 | } 59 | 60 | ip_setup() { 61 | if [ -n "$USB_IFACE" ]; then 62 | ifconfig $USB_IFACE $LOCAL_IP 63 | return 64 | fi 65 | 66 | ifconfig rndis0 $LOCAL_IP && USB_IFACE=rndis0 67 | if [ -z "$USB_IFACE" ]; then 68 | ifconfig usb0 $LOCAL_IP && USB_IFACE=usb0 69 | fi 70 | 71 | if [ -z "$USB_IFACE" ]; then 72 | usb_info "could not setup USB tethering!" 73 | umount_os 74 | return 1 75 | fi 76 | } 77 | 78 | # Minimal mounts for initrd or pre-init debug session 79 | do_mount_devprocsys() 80 | { 81 | mkdir /dev 82 | mount -t devtmpfs devtmpfs /dev 83 | mkdir /dev/pts 84 | mount -t devpts devpts /dev/pts 85 | 86 | mkdir /proc 87 | mkdir /sys 88 | mount -t sysfs sysfs /sys 89 | mount -t proc proc /proc 90 | } 91 | 92 | mount_os() { 93 | if [ -n "$DATA_DEVICE" ]; then 94 | mknod /dev/$DATA_DEVICE b $(grep $DATA_DEVICE /proc/partitions | awk '{print $1" "$2}') 2>> $LOG 95 | if [ -b "/dev/$DATA_DEVICE" ]; then 96 | mkdir /data 97 | mkdir /target 98 | 99 | mount /dev/$DATA_DEVICE /data 100 | mount --bind $DATA_ROOTFS /target 101 | else 102 | echo "Failed to create the node: mknod /dev/$DATA_DEVICE b $(grep $DATA_DEVICE /proc/partitions | awk '{print $1" "$2}')" >> $LOG 103 | return 1 104 | fi 105 | else 106 | echo "Device variable \$DATA_DEVICE not set!" >> $LOG 107 | return 1 108 | fi 109 | } 110 | 111 | umount_os() { 112 | umount /target 113 | umount /data 114 | [ -b "/dev/$DATA_DEVICE" ] && rm -f "/dev/$DATA_DEVICE" 115 | } 116 | 117 | run_debug_session() { 118 | [ -n "$NOTIFICATION_RED_LEDS" ] && \ 119 | [ -f "$NOTIFICATION_RED_LEDS" ] && \ 120 | write "$NOTIFICATION_RED_LEDS" 255 121 | 122 | usb_setup 123 | ip_setup 124 | 125 | if [ $? -eq 0 ]; then 126 | mkdir -p /etc 127 | cat << EOF > /etc/issue.net 128 | Sorry to see you here but welcome ! 129 | 130 | Remark: 131 | - Common error is about /data content not available: 132 | * device not found (/dev/$DATA_DEVICE) ? 133 | * OS not available under ($DATA_ROOTFS) ? 134 | - Issue with the kernel settings : 135 | * do: grep config.gz $LOG 136 | 137 | Useful commands : 138 | - cat $LOG 139 | - grep config.gz $LOG 140 | - cat /proc/partitions 141 | - mount 142 | - cat /init.profile 143 | 144 | Don't be sad, you will fix the problem for sure ! 145 | Once done, you will never see me again :'( 146 | EOF 147 | 148 | telnetd -b ${LOCAL_IP}:${TELNET_PORT} -l /bin/sh 149 | usb_info "Debug: telnet ${LOCAL_IP}:${TELNET_PORT} (no dhcp)" 150 | fi 151 | } 152 | 153 | check_kernel_config() { 154 | if [ ! -e /proc/config.gz ]; then 155 | echo "No /proc/config.gz. Enable CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC" >> $LOG 156 | else 157 | # Must be =y 158 | for x in CONFIG_CGROUPS CONFIG_AUTOFS4_FS CONFIG_DEVTMPFS_MOUNT CONFIG_DEVTMPFS CONFIG_UNIX CONFIG_HOTPLUG CONFIG_INOTIFY_USER CONFIG_SYSVIPC CONFIG_NET CONFIG_PROC_FS CONFIG_SIGNALFD CONFIG_SYSFS CONFIG_TMPFS_POSIX_ACL CONFIG_VT; do 159 | zcat /proc/config.gz | grep -E "^$x=y\$" || echo "$x=y not found in /proc/config.gz" >> $LOG 160 | done 161 | # Must not be =y 162 | for x in CONFIG_ANDROID_LOW_MEMORY_KILLER CONFIG_ANDROID_PARANOID_NETWORK CONFIG_DUMMY CONFIG_SYSFS_DEPRECATED; do 163 | zcat /proc/config.gz | grep -E "^$x=y\$" && echo "$x=y found in /proc/config.gz, must be disabled" >> $LOG 164 | done 165 | fi 166 | } 167 | 168 | #### 169 | # Main 170 | 171 | do_mount_devprocsys 172 | check_kernel_config 173 | mount_os 174 | exec switch_root /target /sbin/init 175 | 176 | #### 177 | # If something failed we will reach this code 178 | # otherwise it will never be executed 179 | 180 | run_debug_session 181 | sleep 3600 182 | -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/initramfs/sbin: -------------------------------------------------------------------------------- 1 | bin -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/initramfs/usr/bin: -------------------------------------------------------------------------------- 1 | ../bin -------------------------------------------------------------------------------- /Android/android_hybris/ramdisk/initramfs/usr/sbin: -------------------------------------------------------------------------------- 1 | ../bin -------------------------------------------------------------------------------- /Docs/archlinux.md: -------------------------------------------------------------------------------- 1 | # Archlinux ARM 2 | 3 | [TOC] 4 | 5 | ## OTA 6 | Flashing procedure can be specific per device so please refer to your ROM maintainer to flash your archlinux ota zip file. 7 | 8 | A general flashing method is described in the `main.md` document if needed. 9 | 10 | ## Installation 11 | ### Quick overview 12 | Archlinux for Android devices follow the spirit of Archlinux. 13 | So once flashed, your device will reboot on a black screen and your system will be minimal without any specific packages installed about Android on it except `hybris-usb` and `dhcp`. 14 | 15 | Those 2 packages are part of the OTA zip file to permit you to access your device with an usb cable. 16 | 17 | ### Connect your device 18 | - Plug your device with the USB cable to your computer 19 | - Check that an IP on the subnet 10.15.19.0/24 is set on your usb/ethernet interface (should be 10.15.19.100 or more) 20 | - Connect to your device with `ssh alarm@10.15.19.82` *(passwd: alarm)* 21 | - Now run `su -` *(passwd: root)* 22 | 23 | **Don't forget to change root and alarm password** 24 | 25 | ### Internet access 26 | Your device will need an internet access* (that can be done offline too but this solution is not documented)*. 27 | To do that, we will [share the Internet connection](https://wiki.archlinux.org/index.php/Internet_sharing) of your computer. Please refer to your OS provider to apply the right procedure. 28 | 29 | Once done, under your Android device run : 30 | ``` 31 | ip route add default via 10.15.19.100 #(adapt the IP) 32 | 33 | cat << EOF > /etc/resolv.conf 34 | nameserver 8.8.8.8 35 | nameserver 8.8.4.4 36 | EOF 37 | ``` 38 | 39 | Once done you can check that everything is fine by doing : 40 | ``` 41 | ping -4 www.archlinux.org 42 | ``` 43 | 44 | ### Packages for base system 45 | ``` 46 | pacman -Syu 47 | pacman -S sudo base-devel 48 | pacman -S ttf-dejavu 49 | ``` 50 | 51 | Configure root permission for alarm user (already member of wheel group) with `visudo` or 52 | `sed -i 's|^# %wheel ALL=(ALL) NOPASSWD: ALL|%wheel ALL=(ALL) NOPASSWD: ALL|' /etc/sudoers` 53 | 54 | Now let's go to install yaourt from AUR: 55 | ``` 56 | #to go back with alarm user 57 | curl -L https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz -o package-query.tar.gz 58 | tar -xzvf package-query.tar.gz 59 | cd package-query 60 | makepkg -s 61 | sudo pacman -U --asdeps package-query-*.pkg.tar.xz 62 | 63 | cd .. 64 | curl -L https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz -o yaourt.tar.gz 65 | tar -xzvf yaourt.tar.gz 66 | cd yaourt 67 | makepkg 68 | sudo pacman -U yaourt-*.pkg.tar.xz 69 | ``` 70 | 71 | Install rsync and git: 72 | ``` 73 | yaourt -S rsync git 74 | ``` 75 | 76 | To speed up compilation with distcc for ARM, please read archlinuxarm [documentation](https://archlinuxarm.org/wiki/Distcc_Cross-Compiling) 77 | 78 | ### Packages for Android device, Qt/Kwin, ... 79 | **IMPORTANT: do not install packages built for another device. Some of them are really specific to your device and Android version (eg: libhybris, hybris-linux, hybris-device, ...). Please never install a kernel not adapted for your device (hybris-linux) !** 80 | 81 | #### Manual 82 | **to run with alarm user** 83 | 84 | Get PKGBUILDs from gnulinux_support to your device. eg: 85 | ``` 86 | cd ~ 87 | git clone https://github.com/mickybart/gnulinux_support 88 | cp -r gnulinux_support/GNULinux/Archlinux/PKGBUILDs . 89 | cd PKGBUILDs 90 | ``` 91 | 92 | Compilation step by step: 93 | ``` 94 | #### 95 | # Core 96 | 97 | #hybris-linux-?-? that you need 98 | cd hybris-linux-- 99 | #if not included, copy the hybris-linux.tgz that matching the device. 100 | makepkg -s 101 | sudo pacman -U --asdeps hybris-linux-*.pkg.tar.xz 102 | cd .. 103 | 104 | #schroot-hybris 105 | cd schroot-hybris 106 | makepkg -s 107 | sudo pacman -U --asdeps schroot*.pkg.tar.xz 108 | cd .. 109 | 110 | #systemd-legacy 111 | #compile it only if you need it. Check PKGBUILD of hybris-device-?-? 112 | cd systemd-legacy 113 | makepkg -s 114 | sudo pacman -U --asdeps {systemd-legacy-libsystemd,systemd-legacy}-2*.pkg.tar.xz 115 | sudo pacman -U systemd-legacy-sysvcompat*.pkg.tar.xz 116 | cd .. 117 | 118 | #hybris-device-?-? that you need 119 | cd hybris-device-- 120 | #if not included, copy the hybris-device.tgz that matching the device. 121 | makepkg -s 122 | sudo pacman -U hybris-device-*.pkg.tar.xz 123 | cd .. 124 | 125 | #mesa-hybris 126 | cd mesa-hybris 127 | makepkg -s --skippgpcheck 128 | sudo pacman -U mesa-hybris-*.pkg.tar.xz 129 | cd .. 130 | 131 | #libhybris_ext 132 | cd libhybris-ext-git 133 | makepkg -s 134 | sudo pacman -U libhybris-ext-*.pkg.tar.xz 135 | cd .. 136 | 137 | #hybris-ready 138 | cd hybris-ready 139 | makepkg -s 140 | sudo pacman -U hybris-ready-0.*.pkg.tar.xz 141 | cd .. 142 | 143 | sudo systemctl enable hybris-ready.service 144 | 145 | #### 146 | # Qt and Kwin 147 | 148 | #If you want to install all Qt5 group: 149 | #sudo pacman -S qt5 150 | 151 | cd qt5-wayland-compositor 152 | makepkg -s 153 | sudo pacman -U qt5-wayland-compositor-*.pkg.tar.xz 154 | cd .. 155 | 156 | cd qt5-qpa-hwcomposer-plugin 157 | makepkg -s 158 | sudo pacman -U qt5-qpa-hwcomposer-plugin-*.pkg.tar.xz 159 | cd .. 160 | 161 | cd qt5-qpa-surfaceflinger-plugin 162 | makepkg -s 163 | sudo pacman -U qt5-qpa-surfaceflinger-plugin-*.pkg.tar.xz 164 | cd .. 165 | 166 | cd kwin-hybris 167 | makepkg -s 168 | sudo pacman -U kwin-hybris-*.pkg.tar.xz 169 | cd .. 170 | 171 | #### 172 | # Boot Animation 173 | # EXPERIMENTAL 174 | cd hybris-ready 175 | sudo pacman -U --asdeps hybris-ready-bootanim-0.*.pkg.tar.xz 176 | cd .. 177 | ``` 178 | 179 | #### AUR (yaourt) 180 | **to run with alarm user** 181 | ``` 182 | #### 183 | # Core 184 | 185 | yaourt -S hybris-ready hybris-device-- #(eg: hybris-device-sony-nozomi) 186 | 187 | sudo systemctl enable hybris-ready.service 188 | 189 | #### 190 | # Qt and Kwin 191 | 192 | yaourt -S hybris-ready-qt5-qpa-meta 193 | yaourt -S hybris-ready-plasma-support-meta 194 | 195 | #### 196 | # Boot Animation 197 | # EXPERIMENTAL 198 | yaourt -S hybris-ready-bootanim 199 | ``` 200 | 201 | #### Binaries 202 | For now, binaries package are not released in a repository but if your device maintainer provides some binaries you can download and install them. 203 | 204 | ### Reboot 205 | ``` 206 | sudo systemctl isolate reboot 207 | ``` 208 | 209 | ### Tests 210 | #### Kernel 211 | Check if everything is fine with `dmesg` 212 | 213 | #### Android boot 214 | Check Android logs (only if you have started hybris-ready.service) : 215 | ``` 216 | sdroid 217 | logcat 218 | 219 | 220 | ``` 221 | 222 | #### hybris 223 | ``` 224 | sudo -i 225 | cd /opt/android/hybris/bin 226 | 227 | #Don't run test like test_hwcomposer, test_glesv2... if you are using surfaceflinger (test_sf / test_ui) 228 | #For more details on those tests check upstream documentation 229 | 230 | ./test_egl 231 | ./test_egl_configs 232 | ./test_vibrator 233 | ./test_... 234 | ``` 235 | 236 | #### QML 237 | Display a qml application (use OpenGL ES) : 238 | ``` 239 | git clone https://github.com/mickybart/hybris-ready-bootanim 240 | cd hybris-ready-bootanim/bootanim 241 | qmlscene-qt5 archlinux.qml 242 | 243 | ``` 244 | 245 | #### Kwin 246 | Start a kwin wayland session with an application : 247 | ``` 248 | # install plasma-meta, kcalc... or alternative to have everything needed for this test. 249 | sudo pacman -S plasma-meta kcalc 250 | 251 | #dbus (do it only once) 252 | export $(dbus-launch) 253 | 254 | #We need to override this value to wayland. Kwin will use the right backend automatically (see kwin_wayland --help). 255 | export QT_QPA_PLATFORM=wayland 256 | kwin_wayland --libinput --xwayland /usr/bin/kcalc 257 | 258 | 259 | #Why not a full plasma session if plasma is installed ? 260 | #you don't need to override QT_QPA_PLATFORM in this case 261 | startplasmacompositor 262 | ``` 263 | 264 | ## And now ? 265 | Just install what you needs as on any GNU/Linux system ! 266 | We just build solid base to work on but the best is to come ! :) 267 | 268 | ## TODO - Developers section 269 | ### hybris-kernel 270 | - [ ] 1. Integrate a flashing procedure during package update (custom per device) + *see if we can protect customer from itself to flash a wrong package* 271 | - [ ] 2. Integrate a solution to create the boot.img + size limit check 272 | - [ ] 3. kernel source compilation (+ prebuild gcc from AOSP) ?? 273 | 274 | With implementation of the first 2 points, it will be possible to create boot.img outside the Android build process. 275 | 276 | For point 3, defconfig file should be part of hybris-kernel package. This point is not mandatory and we can works with a prebuilt kernel from AOSP. As every devices have a specific kernel that maybe doesn't make a lot of interest to do it. 277 | 278 | ### mkinitrd 279 | *(dependency to point 1 and 2 of hybris-kernel)* 280 | Use mkinitrd solution to generate an initramfs with specific hooks (crypto, snapshot, recovery, ...) 281 | 282 | The important part is to create a minimal graphical interface that will permit us to handle some specific hooks like : 283 | - enter a password to uncrypt the device 284 | - boot on a snapshot (for device with btrfs) 285 | - select the ROM to boot on (kexec + hard reboot) 286 | - ... 287 | 288 | This can be something like a new recovery solution oriented for GNU/Linux needs. Maybe based on TWRP or from scratch with Qt/QML ? (code size constraints are low if we use some space under /system that is uncrypted on Android devices. So /data will be able to be fully crypted - included binaries) 289 | 290 | ### sddm 291 | sddm is using QML/Qt and so it is a good fit to have a display manager. 292 | - [ ] Check compatibility with Qt hwcomposer/surfacefinger backend or study a wayland support in addition of Xorg 293 | - [ ] Convergence : theme for portrait mode 294 | - [ ] Virtual keyboard 295 | 296 | ### Plasma-Mobile / Ofono / ... 297 | - [ ] Provide a mobile phone experience 298 | 299 | ### Website for archlinux phone 300 | 301 | - [ ] Discuss with archlinuxarm team to check if they can share some space (wiki/repositories/infra) for this project in their own website. 302 | - [ ] Documentation into the archlinux wiki (mainly a rewrite of this one) 303 | - [ ] Create our own archlinuxphone website and infrastructure (ONLY if it is not possible to be integrated into the archlinuxarm project) 304 | 305 | -------------------------------------------------------------------------------- /Docs/main.md: -------------------------------------------------------------------------------- 1 | # GNU/Linux for Android devices 2 | 3 | [TOC] 4 | 5 | ## Quick overview 6 | GNU/Linux for Android devices is a project to create a convergence between the desktop and the mobile/phablet... so to build new mobile OS based on existing GNU/Linux systems with the most common parts possible. 7 | 8 | We share some common base between mer-hybris (SailfishOS) and Ubuntu Touch but the architecture and integration are not the same. This architecture is described in the section below and should fit for a lot of distributions. Archlinux ARM Phone is the first one to use this architecture. 9 | 10 | So a new OS in the mobile world dominate by Android and iOS ? yes and no. 11 | Archlinux, Fedora, Debian... those systems already exist, are stable and can run on a mobile phone. Graphical interface need to be adapated of course but keep in mind some project like [plasma-mobile](http://plasma-mobile.org/). KDE Team try to create some guideline about convergence for developers. 12 | 13 | Imagine that your cell phone can become your core device ! Plug it to a big screen and this is your workstation ! Plug it to an empty laptop (no CPU, no RAM...) and this is your laptop ! Move everywhere and this is just your mobile phone ! 14 | 15 | This is what motivate this project. 16 | 17 | Applications are critical on a mobile platform and we hope to support Android application as soon as possible. 18 | 19 | Our reference device is a [Sony Xperia S](https://en.wikipedia.org/wiki/Sony_Xperia_S). 20 | Our reference GNU/Linux distribution is [Archlinux](https://www.archlinux.org/) ([archlinuxarm](https://archlinuxarm.org/)). 21 | 22 | ## Architecture 23 | ### Schema 24 | ![architecture](https://github.com/mickybart/gnulinux_support/tree/master/Docs/res/architecture.png) 25 | 26 | ### Constraints 27 | First of all, the libc used into Android (bionic) is not the same than the one used by GNU/Linux (glibc). 28 | A lot of proprietary softwares (drivers, rild,...) are compiled for Android and so are not reusable directly into GNU/Linux. 29 | 30 | Hopefuly some project like libhybris permit to use the Android Hardware from a GNU/Linux environment. 31 | 32 | ### Android and libhybris 33 | libhybris is one of the most important library because it permit to use the Android Hardware from GNU/Linux. 34 | To work, we need to use a modified version of Android. The Android section will provide more detail about those modifications and how to port them to a forked AOSP system like CyanogenMod. 35 | 36 | ### schroot 37 | The Android integration inside the GNU/Linux system is done with a chroot solution. Precisely we are using a modified schroot that permit to support an Android environment. 38 | This approch is different than the two other known implementation from SailfishOS and Ubuntu Touch. 39 | As every implementation, there are some pros and cons. 40 | 41 | schroot permit to isolate the Android environment and to support legacy stuff like /etc symlink. That permit to simplify the Android portage job. 42 | In the same time, we share some filesystem with the GNU/Linux system (eg: /proc, /dev) so it is possible, for example, to use properties directy from GNU/Linux and Android (getprop/setprop). 43 | 44 | schroot permit to join the chroot and to run commands when we want (session support). So it is possible to create some services or commands that can be run from GNU/Linux to interact easily with Android into the chroot. 45 | 46 | This solution permit to have a clean rootfs. Only a symlink /vendor and /system are present on the rootfs due to some libs constraints. 47 | 48 | ### Hwcomposer and SurfaceFlinger 49 | For the renderer, we can use hwcomposer (hwc) direcly but we support SurfaceFlinger too. 50 | It is possible that some device are not working with the direct use of hwc implementation and so that the device will need some troubleshooting and bug fixes. 51 | So to avoid the frustration of the black screen we decided to support the native composer (SurfaceFlinger) of Android as a possibilty. A backend plugin for Qt 5 and Kwin are available. 52 | 53 | ### Wayland 54 | We are using wayland on top of Android Hw. libhybris is compiled with a support of libwayland that replace the mesa implementation to be compatible with Android devices. 55 | 56 | We are using Kwin as our wayland server. 57 | 58 | ### Systemd 59 | We are using systemd as init. 60 | 61 | Android init is fully integrated as a service controlled by systemd. cgroups are used to track Android process and permit to cleanly stop Android environment inside GNU/Linux environment. 62 | 63 | Due to old kernel (3.4) used on a lot of Android devices, we are using a modified systemd version that bring back the support to load firmware from userspace by systemd-udev request. This version is not mandatory and devices with recent kernel can use the upstream systemd. 64 | 65 | ## Android 66 | ##### GNULINUX\_SUPPORT 67 | For remember, we need a modified Android version. To do that we have introduced GNULINUX_SUPPORT as a define for C/C++ and as a boolean variable for Makefiles. 68 | 69 | ``` 70 | Inside a Makefile: 71 | 72 | ifeq ($(GNULINUX_SUPPORT),true) 73 | # make rules for GNU/Linux Android 74 | else 75 | # make rules for Android 76 | endif 77 | 78 | Inside a C/C++ code: 79 | 80 | #ifdef GNULINUX_SUPPORT 81 | /* code for GNU/Linux Android */ 82 | #else 83 | /* code for Android */ 84 | #endif 85 | 86 | ``` 87 | 88 | So GNULINUX_SUPPORT permit to have a common AOSP code to build an Android system or a modified Android system for GNU/Linux. 89 | 90 | That will permit custom ROM based on AOSP like CyanogenMod, Omnirom and others to integrate those patches upstream. So devices porters will be able to focus only on the device tree to adapt it for GNU/Linux. 91 | 92 | ##### AOSP 5.1.1 93 | We have created a [local_manifest.xml](https://github.com/mickybart/android_manifest/tree/gnulinux-support-5.1) that can be used to add GNULINUX_SUPPORT for AOSP 5.1.1. 94 | 95 | Please to find modified repositories: 96 | - [bionic](https://github.com/mickybart/android_bionic/tree/gnulinux-support-5.1) 97 | - [build](https://github.com/mickybart/android_build/tree/gnulinux-support-5.1) 98 | - [frameworks/native](https://github.com/mickybart/android_frameworks_native/tree/gnulinux-support-5.1) 99 | - [system/core](https://github.com/mickybart/android_system_core/tree/gnulinux-support-5.1) 100 | 101 | ##### AOSP 6.0 102 | TODO 103 | 104 | ##### CyanogenMod 12.1 / 13.0 105 | Nothing is ported yet because we have no device with CyanogenMod (CM) but we hope that patches done for AOSP will be ported upstream to CM in the future. 106 | 107 | ##### Android 4.x 108 | We are not supporting any patches for Android 4.x mainly because this version is not supported anymore by Google. 109 | That doesn't mean that it is not possible to use it. Of course the device hardware need to be enough powerful to support a GNU/Linux system. 110 | We will not define what powerful means because it depends of the distribution used, if you want the graphical stack, etc. For exemple if you want a GNU/Linux system with console only to be able to send SMS, share 3G, etc... an old device can fit :) 111 | 112 | For example, this project is developped with a Sony Xperia S phone (that was released with Android 2.3 and at the end with Android 4.1.) 113 | 114 | ## GNU/Linux 115 | ##### Archlinux 116 | Fully supported ([Documentation](https://github.com/mickybart/gnulinux_support/tree/master/Docs/archlinux.md)). 117 | TODO: Archlinux wiki documentation 118 | 119 | ##### What about others ? 120 | To be fully compatible with this project, the heavy work has to be done by packagers of every distributions. The effort is to port packages based on the archlinux implementation to other distribution packaging system (.deb, .rpm, ...). 121 | 122 | To simplify this works, the target distribution needs to support: 123 | - ARM architecture 124 | - systemd 125 | - Qt 5.6 126 | - plasma 5.6 127 | 128 | To support OTA build, distributions need to be defined in the [gnulinux_support project](https://github.com/mickybart/gnulinux_support/tree/master/Android/android_hybris/packaging) 129 | 130 | ## Supported device 131 | ### Installation 132 | **IMPORTANT: We are not responsible of any damage caused to your device. This is up to you to check that everything is done in the right way. Please discuss with the ROM maintainer before if needed** 133 | 134 | Procedure can be slightly different per device so you should read specific instruction provided by the ROM maintainer. 135 | 136 | The general procedure would be similar to this one : 137 | - Download the zip file for your device 138 | - Upload the zip file to your Android device 139 | - Reboot into the recovery (eg: TWRP) to install the zip file 140 | - Reboot into the system 141 | 142 | For 'minimal' distribution, extra steps can be needed : 143 | - Connect your device by usb to your computer 144 | - Connect by ssh to your device (default ip should be 10.15.19.82) 145 | - Continue the installation by following distribution instruction 146 | 147 | ### Source 148 | Follow instruction of the maintainer of your device to compile Android with GNULINUX_SUPPORT and to create the OTA package. 149 | you can read the New device section to have a better understanding of the process. 150 | 151 | ## New device 152 | On this section, you will discover how to port a new device. 153 | 154 | ### Android version 155 | First of all, your device need to have a working Android version to start from. 156 | 157 | ==*It is not mandatory that the installed Android system on your device matches the Android system used for the GNU/Linux support **BUT** you need to be sure that firmware levels are the same between those versions.*== 158 | 159 | Now you need to check in Android section if your Android version is already supported. If this is not the case, you can port patches to your Android version by `git cherry-pick` patches done for AOSP 5.1.1 or 6.0. 160 | 161 | Refer to Android/AOSP 5.1.1 or Android/AOSP 6.0 where you will find all the repositories that need your attention. 162 | 163 | If possible try to push upstream your patches but don't forget to respect the GNULINUX_SUPPORT implementation (read Android/GNULINUX_SUPPORT) 164 | 165 | ### Device tree 166 | On the device tree you need to create a new gnulinux product that will set GNULINUX_SUPPORT to true. 167 | 168 | Please edit or create the 3 files below : 169 | *(Don't forget to replace device_name by the name of your device)* 170 | 171 | `vim device///gnulinux_.mk` 172 | 173 | ``` 174 | GNULINUX_SUPPORT := true 175 | GNULINUX_OTA_OS := archlinux 176 | GNULINUX_OTA_ARCH := armv7 177 | $(call inherit-product, device///aosp_.mk) 178 | PRODUCT_NAME := gnulinux_ 179 | ``` 180 | `vim device///vendorsetup.sh` 181 | ``` 182 | [...] 183 | add_lunch_combo gnulinux_-userdebug 184 | ``` 185 | 186 | `vim device///AndroidProduct.mk` 187 | ``` 188 | [...] 189 | $(LOCAL_DIR)/gnulinux_.mk 190 | ``` 191 | 192 | Once done, you will have to adapt what need to be for compatibility with GNU/Linux. That can be: 193 | - Rename mount path to /dev/block/mmcblk0p... (platform path not yet supported) 194 | - Remove SELinux context for mount options (not yet supported) 195 | - Remove usb management because it will not be handle by Android *(nothing to do if everything is part of init.usb.rc)* 196 | - Set the defconfig file for GNU/Linux kernel *(see Kernel section)* 197 | - Define the BOARD_HYBRIS_RAMDISK_INIT_PROFILE and init.profile file 198 | 199 | To help you, you can check commits done for Nozomi device: 200 | - [new GNU/Linux product](https://github.com/mickybart/device_sony_nozomi/commit/c75945f71ef93b6615b117ecef4324fad3940236) 201 | - [GNU/Linux: Nozomi adaptation](https://github.com/mickybart/device_sony_nozomi/commit/f93afcffc44ff151730c23af5bc65a82f55ece76) 202 | 203 | ### Kernel 204 | Due to incompatible features, you can't use directly the Android kernel and you will have to change some parameters. 205 | 206 | To adapt the kernel, you can compile it outside of you AOSP project by following the [Google guide](http://source.android.com/source/building-kernels.html) or directly inside your AOSP project. 207 | 208 | To help you, under your AOSP repository, you can use the command `gnulinux_support/GNULinux/kernel-check/mer_verify_kernel_config ` to verify and adapt the `.config` file 209 | 210 | This file is located inside AOSP project under `out/target/product//obj/KERNEL_OBJ/.config` or if you are compiling the kernel outside, directly to the root of your kernel. 211 | 212 | **IMPORTANT: CONFIG_AUDIT and SELinux:** 213 | ``` 214 | mer_verify_kernel_config can complain about CONFIG_AUDIT but keep it to y if your kernel is set with SELinux. 215 | For this case, you will have to add extra parameters not checked by the tool : 216 | CONFIG_SECURITY_SELINUX_BOOTPARAM=y 217 | CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 218 | And to add selinux=0 to the CMDLINE of your Kernel 219 | ``` 220 | 221 | **Common issue:** 222 | if gnulinux_support/GNULinux/kernel-check/ is empty, rerun `repo sync --fetch-submodules` 223 | 224 | 225 | ### Compilation 226 | First of all you need to prepare your enviroment for Android compilation. 227 | Please, read the Google [documentation](http://source.android.com/source/requirements.html) or the one of your custom AOSP ROM. 228 | 229 | For a pure AOSP 5.1.1 that will look like this : 230 | 231 | ``` 232 | BRANCH=gnulinux-support-5.1 233 | DEVICE= 234 | URL=https://github.com/mickybart/android_manifest 235 | 236 | repo init -u $URL -b $BRANCH 237 | 238 | mkdir .repo/local_manifests/ 239 | ln -s ../manifests/local_manifest.xml .repo/local_manifests/local_manifest.xml 240 | 241 | repo sync --fetch-submodules 242 | 243 | source build/envsetup.sh 244 | lunch gnulinux_$DEVICE-userdebug 245 | 246 | # build the ota package for the distribution reported by 'lunch' 247 | make otapackage 248 | 249 | # build hybris-*.tgz needed for your distribution and device 250 | make hybris 251 | ``` 252 | 253 | Once done, you should have those files under out/target/product/... folder: 254 | - hybris-device.tgz 255 | - hybris-linux.tgz 256 | - "ota_name".zip (eg: archlinux-armv7-nozomi.zip) 257 | 258 | **IMPORTANT: cleanup** 259 | 260 | If you need to regenerate hybris-\*.tgz files after some modifications, it is safer to delete some files prior under out/target/product/"device"/ folder : `rm -rf hybris-* ramdisk.img` 261 | 262 | 263 | ### Installation 264 | **IMPORTANT: We are not responsible of any damage caused to your device. This is up to you to check that everything is fine and will fit for your device (specially the kernel part).** 265 | 266 | - Create a backup of your device. 267 | - Fash the ota file 268 | - Reboot 269 | 270 | For 'minimal' distribution, extra steps can be needed : 271 | - Connect your device by usb to your computer 272 | - Connect by ssh to your device (default ip should be 10.15.19.82) 273 | 274 | In case of a boot issue, you should see the red notification led if it is configured in the init.profile of the device tree. 275 | To debug the boot sequence, it is possible to connect with telnet to the device by doing those tasks : 276 | - Connect your device by usb to your computer 277 | - run `lsusb -v | grep iSerial` (you should see something like 'Debug: telnet 10.15.19.82:23 (no dhcp)') 278 | - Configure your computer network interface to be on the same lan than your device (that should be 10.15.19.0/24) 279 | - Connect by telnet to your device (`telnet 10.15.19.82 23`). You will have some information to troubleshoot the issue once logged. 280 | 281 | ### GNU/Linux packaging 282 | You should now be able to connect on your device and so it is time to create your binaries packages specific to your device and Android version. This is where we will used files generated by `make hybris`. 283 | 284 | Per distribution: 285 | - [archlinux](https://github.com/mickybart/gnulinux_support/tree/master/Docs/archlinux.md) 286 | 287 | 288 | ## Source code 289 | ### Projects 290 | 291 | Android : 292 | - manifest ([5.1.1](https://github.com/mickybart/android_manifest/tree/gnulinux-support-5.1)) 293 | - build ([5.1.1](https://github.com/mickybart/android_build/tree/gnulinux-support-5.1)) 294 | - bionic ([5.1.1](https://github.com/mickybart/android_bionic/tree/gnulinux-support-5.1)) 295 | - frameworks/native ([5.1.1](https://github.com/mickybart/android_frameworks_native/tree/gnulinux-support-5.1)) 296 | - system/core ([5.1.1](https://github.com/mickybart/android_system_core/tree/gnulinux-support-5.1)) 297 | - [gnulinux_support](https://github.com/mickybart/gnulinux_support) 298 | 299 | GNU/Linux Core : 300 | - [kwin-hybris](https://github.com/mickybart/kwin) (with SurfaceFlinger backend) 301 | - [libhybris_ext](https://github.com/mickybart/libhybris_ext) (With custom compatibility support) 302 | - [qt5-qpa-hwcomposer-plugin](https://github.com/mickybart/qt5-qpa-hwcomposer-plugin) (With Qt 5.6 support) 303 | - [qt5-qpa-surfaceflinger-plugin](https://github.com/mickybart/qt5-qpa-surfaceflinger-plugin) 304 | - [schroot](https://github.com/mickybart/schroot) (With Android support) 305 | - systemd-legacy (With userspace firmware loading for old kernel) 306 | 307 | Archlinux Integration : 308 | - [PKGBUILDs](https://github.com/mickybart/gnulinux_support/tree/master/GNULinux/Archlinux/PKGBUILDs) (hybris-ready, hybris-usb, mesa-hybris, schroot-hybris, hybris-device-sony-nozomi, hybris-linux-sony-nozomi, kwin-hybris, schroot-hybris, ...) 309 | 310 | ### Upstream ? 311 | This project is in an early stage and so we have to prove that our solution is working and of quality. 312 | 313 | We are developing everything with a future upstream support in mind so the code released should be able to be pushed upstream directly or with minor adaptation. We are working for convergence between GNU/Linux desktop and the mobile/tablet so this is not to maintain fork of projects in a long term :) 314 | 315 | Some of them are already be pushed but not necessary approved/committed yet. 316 | 317 | We will update this section with our progress on this topic. 318 | 319 | ## Authors 320 | Michaël Serpieri 321 | -------------------------------------------------------------------------------- /Docs/res/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mickybart/gnulinux_support/86ef8f30156a4c36780ccc2501a0879301002205/Docs/res/architecture.png -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-android-headers/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michaël Serpieri 2 | 3 | # needed to compil libhybris-git, qpa-qt-hwcomposer-plugin, ... 4 | 5 | pkgname=hybris-android-headers 6 | pkgver=5.1.1_30 7 | pkgrel=1 8 | pkgdesc="hybris - Android Headers from AOSP" 9 | arch=('armv7h' 'x86_64') 10 | url="" 11 | license=('custom') 12 | depends=() 13 | options=('!strip') 14 | install='' 15 | source=('gls-common::git+https://github.com/mickybart/gnulinux_support-common') 16 | md5sums=('SKIP') 17 | 18 | prepare() { 19 | mkdir -p ${srcdir}/headers 20 | cd ${srcdir}/headers/ 21 | bsdtar -xpf ${srcdir}/gls-common/aur-blob/${pkgname}/android-headers-${pkgver}.tgz 22 | } 23 | 24 | package() { 25 | cd "${srcdir}/headers" 26 | 27 | install -d "${pkgdir}/opt/android" 28 | 29 | make DESTDIR="$pkgdir/" PREFIX=/opt/android INCLUDEDIR=/opt/android/include PKGCONFIGDIR=/usr/lib/pkgconfig install 30 | sed -i 's|Cflags:.*|Cflags: -I${includedir}|' "${pkgdir}/usr/lib/pkgconfig/android-headers.pc" 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/602-nozomi-extra.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add|change", KERNEL=="event3", SUBSYSTEM=="input", ENV{ID_INPUT_KEY}="", ENV{ID_INPUT_TOUCHSCREEN}="1" 2 | 3 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michaël Serpieri 2 | 3 | # Remarks about /home rule violation (see https://wiki.archlinux.org/index.php/Arch_packaging_standards#Directories) 4 | # 5 | # Android needs to generate a lot of files under /data that will be untracked. 6 | # /data is used for large purpose included media files of the user. 7 | # So /data should fit better under /home than /opt/android/rootfs/data 8 | # We absolutely need to be sure that /home/android is owned by us to don't break anything 9 | 10 | pkgname=hybris-device-sony-nozomi 11 | pkgver=5.1.1_30 12 | pkgrel=2 13 | pkgdesc="hybris - Android for Sony Xperia S (nozomi)" 14 | arch=('armv7h') 15 | url="http://forum.xda-developers.com/xperia-s/s-development/rom-naosprom-xperia-s-t2958516" 16 | license=('custom') 17 | provides=('hybris-device' 'hybris-android-headers') 18 | replaces=('hybris-android-headers') 19 | conflicts=('hybris-android-headers') 20 | depends=('schroot-hybris' 'systemd-legacy' 'hybris-linux-sony-nozomi') 21 | options=('!strip') 22 | install='hybris-device.install' 23 | source=(hybris-device.install 24 | generate-android-udev-rules.sh 25 | generate-android-users.sh 26 | hybris-device.install.template 27 | default.hybris-device 28 | profile.hybris-device.sh 29 | 602-nozomi-extra.rules 30 | hybris-device.tgz) 31 | md5sums=('SKIP' 32 | 'b128af77ca5d2e1c8eeda192baa7b298' 33 | 'abf104cdf8a37a1d3809409666ef29ea' 34 | '69e168c70e61e19fbf86217fa691c084' 35 | '96a74b7fef30065e22906e4a63fe91fa' 36 | '75e4bba978030127135ac0bff97960a1' 37 | '0a8acbb754b21a3d66c3c985614d9e79' 38 | 'SKIP') 39 | _product_out=out/target/product/$(echo $pkgname | cut -d'-' -f4) 40 | 41 | build() { 42 | cd "${srcdir}" 43 | 44 | # Generate udev rules source files 45 | 46 | sh generate-android-udev-rules.sh ./${_product_out}/root 47 | 48 | # Generate groups and users creation based on ./headers 49 | # and create the future .INSTALL of the package 50 | # 51 | # WARNING: before publishing the PKGBUILD sources, 52 | # take care to cleanup hybris-device.install 53 | # with '> hybris-device.install' 54 | # 55 | # NOTE: some users are specific per device and android version 56 | # so for now we handle EVERY users creation in hybris-device 57 | # as part of the portage effort 58 | 59 | sh generate-android-users.sh ./${_product_out} > hybris-device.install 60 | cat hybris-device.install.template >> hybris-device.install 61 | } 62 | 63 | package() { 64 | cd "${srcdir}" 65 | 66 | # Android ramdisk (rootfs) 67 | # 68 | 69 | install -d "${pkgdir}/opt/android" 70 | cp -a ./${_product_out}/root "${pkgdir}/opt/android/rootfs" 71 | chown -R root:root "${pkgdir}/opt/android/rootfs/" 72 | 73 | # Android system 74 | # 75 | 76 | rm -rf "${pkgdir}/opt/android/system" 77 | cp -a ./${_product_out}/system "${pkgdir}/opt/android/system" 78 | chown -R root:root "${pkgdir}/opt/android/system/" 79 | 80 | # Android /data 81 | # 82 | install -d "${pkgdir}/home" 83 | install -d -m 771 -g 1000 -o 1000 "${pkgdir}/home/android" 84 | 85 | # Android integration (needed for libhybris / proprietary lib) 86 | # 87 | ln -s /opt/android/system "${pkgdir}/system" 88 | ln -s /opt/android/system/vendor "${pkgdir}/vendor" 89 | 90 | # Android firmware files 91 | # 92 | # NOTE: 'systemd-legacy' needed for userspace firmware loading. 93 | # If you don't need to load firmware from userspace, 94 | # you can switch dependency to 'systemd' 95 | 96 | install -d "${pkgdir}/usr/lib/firmware/" 97 | cp -r "${pkgdir}"/opt/android/system/etc/firmware/* "${pkgdir}/usr/lib/firmware/" 98 | cp -r "${pkgdir}"/opt/android/system/vendor/firmware/* "${pkgdir}/usr/lib/firmware/" 99 | 100 | # Android headers 101 | # 102 | # NOTE: needed to compil libhybris-git, qpa-qt-hwcomposer-plugin, ... 103 | 104 | cd "$srcdir/${_product_out}/headers" 105 | make DESTDIR="$pkgdir/" PREFIX=/opt/android INCLUDEDIR=/opt/android/include PKGCONFIGDIR=/usr/lib/pkgconfig install 106 | cd "${srcdir}" 107 | sed -i 's|Cflags:.*|Cflags: -I${includedir}|' "${pkgdir}/usr/lib/pkgconfig/android-headers.pc" 108 | 109 | # udev rules for the device 110 | # 111 | # NOTE: review generated rules and patch them here if needed. 112 | # Thanks to report your changes to permit us 113 | # to fix generate-android-udev-rules.sh script 114 | 115 | install -d "${pkgdir}/usr/lib/udev/rules.d/" 116 | cp -L *.rules "${pkgdir}/usr/lib/udev/rules.d/" 117 | 118 | # Configuration file 119 | # 120 | # NOTE: permit to set variables used to configure 121 | # backend, screen parameters, etc for external components 122 | 123 | install -d "${pkgdir}/etc/default" 124 | install -m 644 default.hybris-device "${pkgdir}/etc/default/hybris-device" 125 | 126 | install -d "${pkgdir}/etc/profile.d" 127 | install -m 755 profile.hybris-device.sh "${pkgdir}/etc/profile.d/hybris-device.sh" 128 | 129 | # schroot environment 130 | # 131 | # NOTE: default configuration should be good but 132 | # just in case, we prefer to handle it on this package 133 | # if adaptation is needed about mount, shell etc 134 | 135 | install -d "${pkgdir}/etc" 136 | cp -r /usr/share/schroot/examples/android "${pkgdir}/etc/schroot" 137 | 138 | } 139 | 140 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/default.hybris-device: -------------------------------------------------------------------------------- 1 | #### 2 | # Main configuration for Android Adapatation 3 | # 4 | # This file is used by multiple components linked with Android adaptation 5 | 6 | #### 7 | # Qt QPA plugin for Android 8 | # 9 | # Permit to override automatic screen detection values from: 10 | # 11 | # - qt5-qpa-hwcomposer-plugin 12 | # - qt5-qpa-surfaceflinger-plugin 13 | # 14 | 15 | # Screen physical width in mm (QT_QPA_EGLFS_WIDTH * 25.4 / DPI) 16 | #QT_QPA_EGLFS_PHYSICAL_WIDTH=57 17 | 18 | # Screen physical height in mm (QT_QPA_EGLFS_HEIGHT * 25.4 / DPI) 19 | #QT_QPA_EGLFS_PHYSICAL_HEIGHT=101 20 | 21 | # Screen width in px 22 | #QT_QPA_EGLFS_WIDTH=720 23 | 24 | # Screen height in px 25 | #QT_QPA_EGLFS_HEIGHT=1280 26 | 27 | # Screen depth in bit (16 for RGB565 or 32 for RGBA) 28 | QT_QPA_EGLFS_DEPTH=32 29 | 30 | # Screen refresh rate in hz (60.0 hz by default) 31 | #QT_QPA_EGLFS_REFRESH_RATE=60.0 32 | 33 | #### 34 | # Qt QPA Platform 35 | # 36 | # hwcomposer: 37 | # directly drive the driver to initialize and render to the display. 38 | # 39 | # surfaceflinger: 40 | # client of SurfaceFlinger composer. 41 | # systemd will start surfaceflinger service only in this case during boot 42 | # 43 | # NOTE: if you dynamically change this value, 44 | # don't forget to start or stop surfaceflinger service 45 | 46 | QT_QPA_PLATFORM=surfaceflinger 47 | 48 | #### 49 | # Kwin Wayland 50 | # 51 | 52 | # Backend auto-detection based on environment variables 53 | # uncomment line below to use Kwin SurfaceFlinger backend 54 | SURFACEFLINGER_DISPLAY=0 55 | # uncomment line below to use Kwin Hwcomposer backend 56 | #ANDROID_ROOT=/system 57 | 58 | # Kwin Compose (O2ES for Opengl ES 2.0) 59 | KWIN_COMPOSE=O2ES 60 | 61 | #### 62 | # USB Configuration 63 | # 64 | # Information can be found into Android under /init..usb.rc file 65 | 66 | USB_IDVENDOR=0fce 67 | USB_IDPRODUCT=7169 68 | USB_IPRODUCT="Xperia S" 69 | USB_ISERIAL="CB511W1UFR" 70 | USB_IMANUFACTURER="Archlinux Phone" 71 | 72 | #Network interface used to set the ip (10.15.19.82) for tethering 73 | #(by default we will only try with usb0 or rndis0. see ip link) 74 | #USB_IFACE= 75 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/generate-android-udev-rules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage (){ 4 | cat << EOF 5 | Usage for $0 : $0 6 | 7 | : 8 | Path to Android output folder (eg: /home/aosp/out/target/product/nozomi/root) 9 | 10 | EOF 11 | } 12 | 13 | die () { echo "ERROR: ${1-UNKNOWN}"; exit 1; } 14 | 15 | if [ $# -ne 1 ]; then 16 | usage 17 | exit 1 18 | fi 19 | 20 | #### 21 | # init 22 | 23 | ANDROID_OUT_PRODUCT=$1 24 | 25 | if [ ! -d "$ANDROID_OUT_PRODUCT/" ]; then 26 | usage 27 | die "$ANDROID_OUT_PRODUCT is not a available. please build the boot image" 28 | fi 29 | 30 | [ ! -f "$ANDROID_OUT_PRODUCT/ueventd.rc" ] && die "ueventd.rc not found ! plese build the boot image" 31 | HARDWARE=$(basename $(ls -1 $ANDROID_OUT_PRODUCT/ueventd.*.rc | head -1) | cut -d. -f2) 32 | [ -z "$HARDWARE" ] && die "ueventd..rc not found ! plese build the boot image" 33 | 34 | RULES_ANDROID=600-android-system.rules 35 | RULES_HARDWARE=601-android-system-$HARDWARE.rules 36 | 37 | #### 38 | # ueventd.rc 39 | 40 | cat << EOF > $RULES_ANDROID 41 | # BASE RULES 42 | # 43 | # Support Android (system/core/int/device.c) /dev structure 44 | # log_* moved to /dev/alog/* instead of /dev/log/* because /dev/log is used by glibc (see bionic libhybris patch) 45 | 46 | ACTION=="add", SUBSYSTEM=="graphics", SYMLINK+="graphics/%k", OWNER="root", GROUP="graphics", MODE="0660" 47 | ACTION=="add", SUBSYSTEM=="drm", SYMLINK+="dri/%k", OWNER="root", GROUP="graphics", MODE="0666" 48 | ACTION=="add", SUBSYSTEM=="oncrpc", SYMLINK+="oncrpc/%k", OWNER="root", GROUP="system", MODE="0660" 49 | ACTION=="add", SUBSYSTEM=="adsp", SYMLINK+="adsp/%k", OWNER="system", GROUP="audio", MODE="0660" 50 | ACTION=="add", SUBSYSTEM=="msm_camera", SYMLINK+="msm_camera/%k", OWNER="system", GROUP="system", MODE="0660" 51 | ACTION=="add", SUBSYSTEM=="mtd", SYMLINK+="mtd/%k" 52 | ACTION=="add", SUBSYSTEM=="block", SYMLINK+="block/%k" 53 | ACTION=="add", SUBSYSTEM=="misc", KERNEL=="log_main", SYMLINK+="alog/main", OWNER="root", GROUP="log", MODE="0666" 54 | ACTION=="add", SUBSYSTEM=="misc", KERNEL=="log_events", SYMLINK+="alog/events", OWNER="root", GROUP="log", MODE="0666" 55 | ACTION=="add", SUBSYSTEM=="misc", KERNEL=="log_radio", SYMLINK+="alog/radio", OWNER="root", GROUP="log", MODE="0666" 56 | ACTION=="add", SUBSYSTEM=="misc", KERNEL=="log_system", SYMLINK+="alog/system", OWNER="root", GROUP="log", MODE="0666" 57 | 58 | # Extra permissions set from system/core/rootdir/ueventd.rc 59 | 60 | EOF 61 | 62 | cat $ANDROID_OUT_PRODUCT/ueventd.rc | grep ^/dev|sed -e 's/^\/dev\///'|awk '{printf "ACTION==\"add\", KERNEL==\"%s\", OWNER=\"%s\", GROUP=\"%s\", MODE=\"%s\"\n",$1,$3,$4,$2}' | sed -e 's/\r//' | egrep -v '"graphics/|"dri/|"oncrpc/|"adsp/|"msm_camera/|"log/' >> $RULES_ANDROID 63 | 64 | #### 65 | # ueventd..rc 66 | 67 | cat << EOF > $RULES_HARDWARE 68 | # RULES for $HARDWARE 69 | # 70 | # Based on root/ueventd.$HARDWARE.rc 71 | 72 | EOF 73 | 74 | cat $ANDROID_OUT_PRODUCT/ueventd.$HARDWARE.rc | grep ^/dev|sed -e 's/^\/dev\///'|awk '{printf "ACTION==\"add\", KERNEL==\"%s\", OWNER=\"%s\", GROUP=\"%s\", MODE=\"%s\"\n",$1,$3,$4,$2}' | sed -e 's/\r//' >> $RULES_HARDWARE 75 | 76 | #### 77 | # check base rules override from ueventd.$HARDWARE.rc 78 | 79 | sed -i 's|KERNEL=="graphics/\(.*\)|SUBSYSTEM=="graphics", KERNEL=="\1, SYMLINK+="graphics/%k"|' $RULES_HARDWARE 80 | sed -i 's|KERNEL=="dri/\(.*\)|SUBSYSTEM=="drm", KERNEL=="\1, SYMLINK+="dri/%k"|' $RULES_HARDWARE 81 | sed -i 's|KERNEL=="oncrpc/\(.*\)|SUBSYSTEM=="oncrpc", KERNEL=="\1, SYMLINK+="oncrpc/%k"|' $RULES_HARDWARE 82 | sed -i 's|KERNEL=="adsp/\(.*\)|SUBSYSTEM=="adsp", KERNEL=="\1, SYMLINK+="adsp/%k"|' $RULES_HARDWARE 83 | sed -i 's|KERNEL=="msm_camera/\(.*\)|SUBSYSTEM=="msm_camera", KERNEL=="\1, SYMLINK+="msm_camera/%k"|' $RULES_HARDWARE 84 | sed -i 's|KERNEL=="mtd/\(.*\)|SUBSYSTEM=="mtd", KERNEL=="\1, SYMLINK+="mtd/%k"|' $RULES_HARDWARE 85 | 86 | #### 87 | # hw_random 88 | 89 | sed -i 's|ACTION=="add", KERNEL=="hw_random"\(.*\)|ACTION=="add", KERNEL=="hw_random"\1, SYMLINK+="hw_random"|' $RULES_ANDROID 90 | sed -i 's|ACTION=="add", KERNEL=="hw_random"\(.*\)|ACTION=="add", KERNEL=="hw_random"\1, SYMLINK+="hw_random"|' $RULES_HARDWARE 91 | 92 | if ! grep -q 'hw_random' $RULES_ANDROID && ! grep -q 'hw_random' $RULES_HARDWARE; then 93 | 94 | cat << EOF >> $RULES_ANDROID 95 | 96 | # hw_random is named hwrng by systemd-udev so we need a symlink hw_random 97 | ACTION=="add", SUBSYSTEM=="misc", KERNEL=="hw_random", SYMLINK+="hw_random" 98 | EOF 99 | 100 | fi 101 | 102 | 103 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/generate-android-users.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | usage (){ 4 | cat << EOF 5 | Usage for $0 : $0 6 | 7 | : 8 | Path to Android product output folder (eg: /home/aosp/out/target/product/nozomi) 9 | 10 | EOF 11 | } 12 | 13 | die () { echo "ERROR: ${1-UNKNOWN}"; exit 1; } 14 | 15 | if [ $# -ne 1 ]; then 16 | usage 17 | exit 1 18 | fi 19 | 20 | CONFIG_H=$1/headers/private/android_filesystem_config.h 21 | 22 | [ -f $CONFIG_H ] || exit -1 23 | 24 | cat << EOGEN 25 | # generate during makepkg by generate-android-users.sh 26 | 27 | #### 28 | # Variables 29 | 30 | $(egrep '^#define AID' $CONFIG_H | sed 's/#define //;s/ \/\*.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{print $1"="$2}') 31 | 32 | #### 33 | # Hidden Post install 34 | 35 | _post_install(){ 36 | 37 | # Create groups 38 | 39 | $(egrep '^ { "' $CONFIG_H | sed 's/^ { "//;s/",//;s/, },.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{ print "\tgroupadd -g $"$2" "$1" &>/dev/null"}') 40 | 41 | # Create users 42 | 43 | $(egrep '^ { "' $CONFIG_H | sed 's/^ { "//;s/",//;s/, },.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{ print "\tuseradd -M -s /usr/bin/nologin -c \"Android ("$2")\" -g $"$2" -u $"$2" "$1" &>/dev/null"}') 44 | 45 | } #end post_install() 46 | 47 | #### 48 | # Hidden Post upgrade 49 | 50 | _post_upgrade(){ 51 | 52 | # IMPORTANT: we will not take care of uid/gid change and users to delete here. 53 | # you need to take that into account into hybris-device.install script 54 | 55 | # Create missing groups 56 | 57 | $(egrep '^ { "' $CONFIG_H | sed 's/^ { "//;s/",//;s/, },.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{ print "\tgetent group "$1" >/dev/null 2>&1 || groupadd -g $"$2" "$1" &>/dev/null"}') 58 | 59 | # Create missing users 60 | 61 | $(egrep '^ { "' $CONFIG_H | sed 's/^ { "//;s/",//;s/, },.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{ print "\tgetent passwd "$1" >/dev/null 2>&1 || useradd -M -s /usr/bin/nologin -c \"Android ("$2")\" -g $"$2" -u $"$2" "$1" &>/dev/null"}') 62 | 63 | } #end post_upgrade() 64 | 65 | #### 66 | # Dump 67 | # 68 | #dump(){ 69 | # 70 | # # dump what is needed 71 | # 72 | # cat << EOF 73 | # 74 | # #### 75 | # # Groups 76 | # 77 | $(egrep '^ { "' $CONFIG_H | sed 's/^ { "//;s/",//;s/, },.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{ print "#\t\tgroupadd -g \\$"$2" "$1}') 78 | # 79 | # #### 80 | # # Users 81 | # 82 | $(egrep '^ { "' $CONFIG_H | sed 's/^ { "//;s/",//;s/, },.*//' | egrep -v 'AID_ROOT|AID_NOBODY' | awk '{ print "#\t\tuseradd -M -s /usr/bin/nologin -c \"Android ("$2")\" -g \\$"$2" -u \\$"$2" "$1}') 83 | # 84 | #EOF 85 | # 86 | #} # end dump 87 | 88 | EOGEN 89 | 90 | 91 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/hybris-device.install: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mickybart/gnulinux_support/86ef8f30156a4c36780ccc2501a0879301002205/GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/hybris-device.install -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/hybris-device.install.template: -------------------------------------------------------------------------------- 1 | 2 | #### 3 | # post_install is used for a New installation 4 | # see https://wiki.archlinux.org/index.php/PKGBUILD#install 5 | 6 | post_install(){ 7 | # let's go to run the generated _post_install 8 | # see generate-android-users.sh 9 | _post_install $1 10 | } 11 | 12 | #### 13 | # post upgrade is used for an upgrade 14 | # see https://wiki.archlinux.org/index.php/PKGBUILD#install 15 | 16 | post_upgrade(){ 17 | NEW_VERSION=$1 18 | OLD_VERSION=$2 19 | 20 | # Delete users: 21 | # 22 | # if between 2 packages version you don't need some previous users, 23 | # you will need to delete them here 24 | # 25 | # IMPORTANT: be careful to don't delete a system user/group 26 | 27 | #userdel... groupdel... (don't forget to delete the main group of the user) 28 | 29 | # Modify users: 30 | # 31 | # Same than delete. Please handle users/groups change here 32 | # 33 | # IMPORTANT: be careful to don't modify a system user/group 34 | 35 | #usermod... groupmod... 36 | 37 | # Now let's go to run the generated _post_upgrade 38 | # see generate-android-users.sh 39 | _post_upgrade $NEW_VERSION $OLD_VERSION 40 | } 41 | 42 | #### 43 | # post remove 44 | # see https://wiki.archlinux.org/index.php/PKGBUILD#install 45 | 46 | post_remove(){ 47 | printf '==> Android should have created untracked files under /opt/android/rootfs. Please check to manually clean them.\n' 48 | printf ' The same situation occurs for /home/android (equivalent to /data under Android)\n' 49 | } 50 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-device-sony-nozomi/profile.hybris-device.sh: -------------------------------------------------------------------------------- 1 | #### 2 | # Init hybris variables 3 | 4 | source /etc/default/hybris-device 5 | 6 | #### 7 | # Export useful variables 8 | 9 | export QT_QPA_EGLFS_PHYSICAL_WIDTH 10 | export QT_QPA_EGLFS_PHYSICAL_HEIGHT 11 | export QT_QPA_EGLFS_WIDTH 12 | export QT_QPA_EGLFS_HEIGHT 13 | export QT_QPA_EGLFS_DEPTH 14 | export QT_QPA_EGLFS_REFRESH_RATE 15 | 16 | export QT_QPA_PLATFORM 17 | 18 | export SURFACEFLINGER_DISPLAY 19 | export ANDROID_ROOT 20 | export KWIN_COMPOSE 21 | 22 | #export USB_IDVENDOR 23 | #export USB_IDPRODUCT 24 | #export USB_IPODUCT 25 | #export USB_ISERIAL 26 | #export USB_IMANUFACTURER 27 | #export USB_IFACE 28 | 29 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-linux-sony-nozomi/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michaël Serpieri 2 | 3 | pkgname=hybris-linux-sony-nozomi 4 | pkgver=5.1.1_30 5 | pkgrel=1 6 | pkgdesc="hybris - The Linux kernel for Sony Xperia S (nozomi)" 7 | arch=('armv7h') 8 | url="http://forum.xda-developers.com/xperia-s/s-development/rom-naosprom-xperia-s-t2958516" 9 | license=('custom') 10 | provides=('hybris-linux') 11 | depends=() 12 | options=('!strip') 13 | source=(hybris-linux.tgz) 14 | md5sums=('SKIP') 15 | _product_out=out/target/product/$(echo $pkgname | cut -d'-' -f4) 16 | 17 | build() { 18 | cd "${srcdir}" 19 | 20 | } 21 | 22 | package() { 23 | cd "${srcdir}" 24 | 25 | install -d ${pkgdir}/opt/android/boot 26 | install -m 644 ./${_product_out}/boot.img ${pkgdir}/opt/android/boot/ 27 | 28 | # fix kernel error due to v4l_id 29 | install -d "${pkgdir}/etc/udev/rules.d/" 30 | cat << EOF > "${pkgdir}/etc/udev/rules.d/60-persistent-v4l.rules" 31 | #### 32 | # Owner: hybris-linux package 33 | # 34 | # Override /usr/lib/udev/rules.d/60-persistent-v4l.rules 35 | # to avoid kernel errors reported with v4l_id 36 | EOF 37 | 38 | # TODO: 39 | # - provide a script to flash the boot.img 40 | # - .install to handle flash procedure (or not depending user choice ?) 41 | # - take care of recovery.img here or on another package 42 | # - support mkinitcpio with specific hook for Android boot.img structure 43 | # => kernel source ? (some devices use hardcoded CMDLINE into kernel .config file) 44 | # => provide mkbootimg or platform specific mkboot (boot.img are not all compliant with default Android boot structure) 45 | # - what about multirom and kexec hard reboot support ? 46 | # 47 | # NOTE: mkinitcpio hook support (like crypto, btrfs,...) + multirom support (like a grub2) 48 | # will probably need a new recovery project or TWRP adaptation (to be study) 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-ready/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | pkgbase=hybris-ready 4 | pkgname=('hybris-ready' 'hybris-ready-bootanim' 'hybris-ready-qt5-qpa-meta' 'hybris-ready-plasma-support-meta') 5 | pkgver=0.2 6 | pkgrel=1 7 | arch=('armv7h') 8 | url="https://github.com/mickybart/" 9 | license=('') 10 | makedepends=() 11 | source=('hybris-ready.install' 12 | 'gls-common::git+https://github.com/mickybart/gnulinux_support-common' 13 | 'bootanim::git+https://github.com/mickybart/hybris-ready-bootanim') 14 | md5sums=('81c15ce7b501b7806057a92605757578' 15 | 'SKIP' 16 | 'SKIP') 17 | 18 | build() { 19 | cd ${srcdir} 20 | 21 | } 22 | 23 | package_hybris-ready() { 24 | pkgdesc="hybris ready permit to fully support GNU/Linux and Android Hardware" 25 | depends=('hybris-usb' 26 | 'libhybris' 'libgl' 'libwayland-egl' 27 | 'inotify-tools') 28 | optdepends=('hybris-device: required to support an android device' 29 | 'hybris-ready-bootanim: required to display a pretty boot animation') 30 | install='hybris-ready.install' 31 | 32 | cd ${srcdir} 33 | 34 | # services for hybris-ready 35 | install -d ${pkgdir}/usr/bin 36 | install -m 755 gls-common/init/android-init ${pkgdir}/usr/bin/ 37 | 38 | install -d ${pkgdir}/usr/lib/systemd/system/ 39 | install -m 644 gls-common/systemd/units/hybris-ready.service ${pkgdir}/usr/lib/systemd/system/ 40 | install -m 644 gls-common/systemd/units/hybris-ready-completed.service ${pkgdir}/usr/lib/systemd/system/ 41 | 42 | # special services and target for Android Hw 43 | install -m 644 gls-common/systemd/units/hybris-reboot-bootloader.service ${pkgdir}/usr/lib/systemd/system/ 44 | install -m 644 gls-common/systemd/units/hybris-reboot-recovery.service ${pkgdir}/usr/lib/systemd/system/ 45 | install -m 644 gls-common/systemd/units/bootloader.target ${pkgdir}/usr/lib/systemd/system/ 46 | install -m 644 gls-common/systemd/units/recovery.target ${pkgdir}/usr/lib/systemd/system/ 47 | 48 | } 49 | 50 | package_hybris-ready-bootanim() { 51 | pkgdesc="Boot animation for hybris system" 52 | depends=('hybris-ready' 53 | 'hybris-ready-qt5-qpa-meta' 54 | 'qt5-declarative' 'qt5-svg') 55 | 56 | cd ${srcdir} 57 | 58 | # share 59 | install -d ${pkgdir}/usr/share/hybris-ready-bootanim/ 60 | cp -r ${srcdir}/bootanim/bootanim/* ${pkgdir}/usr/share/hybris-ready-bootanim/ 61 | ln -s archlinux.qml ${pkgdir}/usr/share/hybris-ready-bootanim/active.qml 62 | 63 | # Boot Animation service 64 | install -d ${pkgdir}/usr/lib/systemd/system/ 65 | install -m 644 ${srcdir}/bootanim/systemd/hybris-ready-bootanim.service ${pkgdir}/usr/lib/systemd/system/ 66 | 67 | } 68 | 69 | package_hybris-ready-qt5-qpa-meta() { 70 | pkgdesc="Qt QPA Platform for hybris" 71 | depends=('hybris-ready' 'qt5-wayland-hybris' 72 | 'qt5-qpa-hwcomposer-plugin' 'qt5-qpa-surfaceflinger-plugin') 73 | 74 | } 75 | 76 | package_hybris-ready-plasma-support-meta() { 77 | pkgdesc="plasma support for hybris system" 78 | depends=('hybris-ready' 'qt5-wayland-hybris' 'kwin-hybris') 79 | 80 | } 81 | 82 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-ready/hybris-ready.install: -------------------------------------------------------------------------------- 1 | 2 | post_install(){ 3 | printf '===> Android Hardware: \n' 4 | printf ' please install an hybris-device that matching your hardware\n' 5 | printf '===> Android initialization : \n' 6 | printf ' systemctl enable hybris-ready.service\n\n' 7 | } 8 | 9 | post_upgrade(){ 10 | post_install 11 | } 12 | 13 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-usb/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michaël Serpieri 2 | 3 | pkgname=hybris-usb 4 | pkgver=0.1 5 | pkgrel=2 6 | pkgdesc="USB control for Android with hybris" 7 | arch=('armv7h') 8 | url="" 9 | license=('custom') 10 | provides=() 11 | depends=('systemd' 'dhcp') 12 | options=() 13 | source=('usb-tethering' 14 | 'usb-tethering.service' 15 | 'dhcpd.conf' 16 | 'dhcpd4.service-customexec.conf' 17 | 'tmpfiles.d.hybris-usb.conf') 18 | md5sums=('2d270508c91e94997236e5dacd7bbc8d' 19 | '7976b6c3d662802cc54e3458ec3b891e' 20 | '8d25b1c3f1146635800db77f300b908c' 21 | '0aff78dea49297c615946ee310c49a6b' 22 | '91422a3f2a69c9800d25cd65358fe5df') 23 | 24 | build() { 25 | cd "${srcdir}" 26 | 27 | } 28 | 29 | package() { 30 | cd "${srcdir}" 31 | 32 | # usb tethering 33 | 34 | install -d ${pkgdir}/usr/bin 35 | install -m 755 usb-tethering ${pkgdir}/usr/bin/ 36 | 37 | install -d ${pkgdir}/usr/lib/systemd/system/ 38 | install -m 644 usb-tethering.service ${pkgdir}/usr/lib/systemd/system/ 39 | 40 | # dhcpd configuration 41 | 42 | install -d ${pkgdir}/usr/lib/tmpfiles.d/ 43 | install -m 644 tmpfiles.d.hybris-usb.conf ${pkgdir}/usr/lib/tmpfiles.d/hybris-usb.conf 44 | 45 | install -d ${pkgdir}/etc/systemd/system/dhcpd4.service.d/ 46 | install -m 644 dhcpd4.service-customexec.conf ${pkgdir}/etc/systemd/system/dhcpd4.service.d/customexec.conf 47 | 48 | install -d ${pkgdir}/etc/hybris-usb/ 49 | install -m 644 dhcpd.conf ${pkgdir}/etc/hybris-usb/ 50 | } 51 | 52 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-usb/dhcpd.conf: -------------------------------------------------------------------------------- 1 | option domain-name-servers 8.8.8.8, 8.8.4.4; 2 | option subnet-mask 255.255.255.0; 3 | subnet 10.15.19.0 netmask 255.255.255.0 { 4 | range 10.15.19.100 10.15.19.254; 5 | } 6 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-usb/dhcpd4.service-customexec.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | PIDFile=/run/hybris-usb/dhcpd4.pid 3 | ExecStart= 4 | ExecStart=/usr/bin/dhcpd -4 -q -cf /etc/hybris-usb/dhcpd.conf -pf /run/hybris-usb/dhcpd4.pid -lf /run/hybris-usb/dhcpd4.lease 5 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-usb/tmpfiles.d.hybris-usb.conf: -------------------------------------------------------------------------------- 1 | d /run/hybris-usb 0755 root root 2 | f /run/hybris-usb/dhcpd4.lease 0644 root root 3 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-usb/usb-tethering: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #### 4 | # Default profile 5 | USB_IDVENDOR=0fce 6 | USB_IDPRODUCT=7169 7 | USB_IPRODUCT="Unknown" 8 | USB_ISERIAL="Unknown" 9 | USB_IMANUFACTURER="GNU/Linux Device" 10 | USB_IFACE="" 11 | 12 | #### 13 | # Override profile 14 | if [ -f /etc/default/hybris-device ]; then 15 | source /etc/default/hybris-device 16 | fi 17 | 18 | ANDROID_USB=/sys/class/android_usb/android0 19 | USB_FUNCTIONS=rndis 20 | LOCAL_IP=10.15.19.82 21 | 22 | write() { 23 | echo -n "$2" > "$1" 24 | } 25 | 26 | usb_setup() { 27 | write $ANDROID_USB/enable 0 28 | write $ANDROID_USB/idVendor $USB_IDVENDOR 29 | write $ANDROID_USB/idProduct $USB_IDPRODUCT 30 | write $ANDROID_USB/iManufacturer "$USB_IMANUFACTURER" 31 | write $ANDROID_USB/iProduct "$USB_IPRODUCT" 32 | write $ANDROID_USB/iSerial "$USB_ISERIAL" 33 | write $ANDROID_USB/functions $USB_FUNCTIONS 34 | write $ANDROID_USB/enable 1 35 | } 36 | 37 | usb_info() { 38 | write $ANDROID_USB/iSerial "$1" 39 | } 40 | 41 | ip_setup() { 42 | if [ -n "$USB_IFACE" ]; then 43 | ifconfig $USB_IFACE $LOCAL_IP 44 | return 45 | fi 46 | 47 | ifconfig rndis0 $LOCAL_IP && USB_IFACE=rndis0 48 | if [ -z "$USB_IFACE" ]; then 49 | ifconfig usb0 $LOCAL_IP && USB_IFACE=usb0 50 | fi 51 | 52 | if [ -z "$USB_IFACE" ]; then 53 | usb_info "could not setup USB tethering!" 54 | return 1 55 | fi 56 | 57 | usb_info "$USB_IMANUFACTURER on $USB_IFACE $LOCAL_IP" 58 | } 59 | 60 | usb_setup 61 | ip_setup 62 | 63 | exit $? 64 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/hybris-usb/usb-tethering.service: -------------------------------------------------------------------------------- 1 | # systemd service file for usb-tethering 2 | 3 | [Unit] 4 | Wants=dhcpd4.service 5 | Description=USB Tethering 6 | ConditionPathExists=/sys/class/android_usb/android0 7 | 8 | [Service] 9 | Type=oneshot 10 | ExecStart=/bin/bash /usr/bin/usb-tethering 11 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/kwin-hybris/PKGBUILD: -------------------------------------------------------------------------------- 1 | # $Id: PKGBUILD 265462 2016-04-19 15:09:32Z arojas $ 2 | # Maintainer: Michael Serpieri 3 | # Contributor: Felix Yan 4 | # Contributor: Andrea Scarpino 5 | 6 | pkgname=kwin-hybris 7 | _pkgname=kwin 8 | pkgver=5.9.5 9 | pkgrel=1 10 | pkgdesc='KDE Window manager' 11 | arch=('i686' 'x86_64' 'armv7h') 12 | url='https://projects.kde.org/projects/kde/workspace/kwin' 13 | license=('LGPL') 14 | depends=('kscreenlocker' 'xcb-util-cursor' 'hicolor-icon-theme' 'plasma-framework' 'kcmutils' 'breeze' 'libhybris') 15 | makedepends=('extra-cmake-modules' 'qt5-tools' 'kdoctools' 'python') 16 | optdepends=('qt5-virtualkeyboard: virtual keyboard support for kwin-wayland') 17 | groups=('plasma') 18 | provides=('kwin') 19 | conflicts=('kdebase-workspace' 'kwin') 20 | source=("kwin::git+https://github.com/mickybart/kwin#branch=sf-v${pkgver}") 21 | md5sums=('SKIP') 22 | 23 | prepare() { 24 | mkdir -p build 25 | } 26 | 27 | build() { 28 | cd build 29 | cmake ../${_pkgname} \ 30 | -DCMAKE_BUILD_TYPE=Release \ 31 | -DCMAKE_INSTALL_PREFIX=/usr \ 32 | -DKDE_INSTALL_LIBDIR=lib \ 33 | -DKDE_INSTALL_LIBEXECDIR=lib \ 34 | -DBUILD_TESTING=OFF 35 | make 36 | } 37 | 38 | package() { 39 | cd build 40 | make DESTDIR="${pkgdir}" install 41 | } 42 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/kwin-hybris/kwin.install: -------------------------------------------------------------------------------- 1 | post_install() { 2 | xdg-icon-resource forceupdate --theme hicolor &> /dev/null 3 | } 4 | 5 | post_upgrade() { 6 | post_install 7 | } 8 | 9 | post_remove() { 10 | post_install 11 | } 12 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/libhybris-ext-git/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | pkgbase=libhybris-ext-git 4 | pkgname=('libhybris-ext-git' 'libhybris-ext-libgl-git' 'libhybris-ext-wayland-egl-git') 5 | _pkgbase=libhybris 6 | pkgver=1245.a1f2e5d 7 | pkgrel=2 8 | arch=('armv7h') 9 | url="https://github.com/mickybart/libhybris_ext" 10 | license=('Apache') 11 | makedepends=('wayland' 'hybris-android-headers') 12 | source=("libhybris::git+https://github.com/mickybart/libhybris_ext#branch=master-next") 13 | md5sums=('SKIP') 14 | 15 | pkgver() { 16 | cd "${srcdir}/${_pkgbase}" 17 | echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) 18 | } 19 | 20 | prepare() { 21 | cd "${_pkgbase}" 22 | 23 | } 24 | 25 | build() { 26 | cd "${srcdir}/${_pkgbase}/hybris" 27 | 28 | ./autogen.sh \ 29 | --prefix=/opt/android/hybris \ 30 | --with-android-headers=/opt/android/include \ 31 | --enable-wayland 32 | make 33 | 34 | # fake installation 35 | mkdir ${srcdir}/fakeinstall 36 | # lib dependency issue: workaround with -j1 37 | make -j1 DESTDIR="${srcdir}/fakeinstall" install 38 | } 39 | 40 | package_libhybris-ext-git() { 41 | pkgdesc="hybris allows to use bionic-based HW adaptations in glibc systems (ext version)" 42 | depends=('hybris-android-headers') 43 | provides=('libhybris') 44 | conflicts=('libhybris') 45 | 46 | cd "${srcdir}/${_pkgbase}/hybris" 47 | 48 | cp -av ${srcdir}/fakeinstall/* ${pkgdir}/ 49 | 50 | # move pkgconfig to standard path 51 | install -m755 -d "${pkgdir}/usr/lib/" 52 | mv "${pkgdir}/opt/android/hybris/lib/pkgconfig" "${pkgdir}/usr/lib/" 53 | rm -f ${pkgdir}/usr/lib/pkgconfig/{egl,glesv1_cm,glesv2,wayland-egl}.pc 54 | 55 | # create symlink to /usr/lib for every lib except those handle by package libgl, libwayland-egl 56 | find ${pkgdir}/opt/android/hybris/lib/ -type l -exec cp -a {} ${pkgdir}/usr/lib/ \; 57 | for i in $(find ${pkgdir}/opt/android/hybris/lib/ -not -type l -type f); do 58 | ln -s /opt/android/hybris/lib/$(basename $i) ${pkgdir}/usr/lib/ 59 | done 60 | for i in $(find ${pkgdir}/usr/lib/ -name 'libEGL.so*' -or -name 'libGLES*' -or -name 'libwayland-egl.so*'); do 61 | rm -f $i 62 | done 63 | } 64 | 65 | package_libhybris-ext-libgl-git() { 66 | pkgdesc="hybris 3-D graphics library" 67 | depends=('libhybris' 'libhybris-ext-wayland-egl-git' 'mesa-hybris') 68 | provides=('libgl') 69 | replaces=('libgl') 70 | conflicts=('libgl') 71 | 72 | install -m755 -d ${pkgdir}/usr/lib/pkgconfig 73 | cp -av ${srcdir}/fakeinstall/opt/android/hybris/lib/pkgconfig/{egl,glesv1_cm,glesv2}.pc ${pkgdir}/usr/lib/pkgconfig/ 74 | 75 | # WORKAROUND: libGL is not provided by libhybris so we use the one from mesa. 76 | # Of course it will NOT work but we need it for Xwayland used kwin_wayland. 77 | # Xwayland support should be broken and will need some analyze and fix. 78 | ln -s /usr/lib/mesa/libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so.1.2.0 79 | ln -s libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so.1 80 | ln -s libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so 81 | 82 | ln -s /opt/android/hybris/lib/libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1.0.0 83 | ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1 84 | ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so 85 | 86 | ln -s /opt/android/hybris/lib/libGLESv1_CM.so.1.0.1 ${pkgdir}/usr/lib/libGLESv1_CM.so.1.0.1 87 | ln -s libGLESv1_CM.so.1.0.1 ${pkgdir}/usr/lib/libGLESv1_CM.so.1 88 | ln -s libGLESv1_CM.so.1.0.1 ${pkgdir}/usr/lib/libGLESv1_CM.so 89 | 90 | ln -s /opt/android/hybris/lib/libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2.0.0 91 | ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2 92 | ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so 93 | 94 | } 95 | 96 | package_libhybris-ext-wayland-egl-git() { 97 | pkgdesc="hybris 3-D wayland library" 98 | depends=('libhybris') 99 | provides=('libwayland-egl') 100 | replaces=('libwayland-egl') 101 | conflicts=('libwayland-egl') 102 | 103 | install -m755 -d ${pkgdir}/usr/lib/pkgconfig 104 | cp ${srcdir}/fakeinstall/opt/android/hybris/lib/pkgconfig/wayland-egl.pc ${pkgdir}/usr/lib/pkgconfig 105 | 106 | ln -s /opt/android/hybris/lib/libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so.1.0.0 107 | ln -s libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so.1 108 | ln -s libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so 109 | } 110 | 111 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/libhybris-git/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | pkgbase=libhybris-git 4 | pkgname=('libhybris-git' 'libhybris-libgl-git' 'libhybris-wayland-egl-git') 5 | _pkgbase=libhybris 6 | pkgver=1237.cfd9823 7 | pkgrel=2 8 | arch=('armv7h') 9 | url="https://github.com/libhybris/libhybris" 10 | license=('Apache') 11 | makedepends=('wayland' 'hybris-android-headers') 12 | source=("libhybris::git+https://github.com/libhybris/libhybris") 13 | md5sums=('SKIP') 14 | 15 | pkgver() { 16 | cd "${srcdir}/${_pkgbase}" 17 | echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) 18 | } 19 | 20 | prepare() { 21 | cd "${_pkgbase}" 22 | 23 | } 24 | 25 | build() { 26 | cd "${srcdir}/${_pkgbase}/hybris" 27 | 28 | ./autogen.sh \ 29 | --prefix=/opt/android/hybris \ 30 | --with-android-headers=/opt/android/include \ 31 | --enable-wayland 32 | make 33 | 34 | # fake installation 35 | mkdir ${srcdir}/fakeinstall 36 | # lib dependency issue: workaround with -j1 37 | make -j1 DESTDIR="${srcdir}/fakeinstall" install 38 | } 39 | 40 | package_libhybris-git() { 41 | pkgdesc="hybris allows to use bionic-based HW adaptations in glibc systems" 42 | depends=('hybris-android-headers') 43 | provides=('libhybris') 44 | conflicts=('libhybris') 45 | 46 | cd "${srcdir}/${_pkgbase}/hybris" 47 | 48 | cp -av ${srcdir}/fakeinstall/* ${pkgdir}/ 49 | 50 | # move pkgconfig to standard path 51 | install -m755 -d "${pkgdir}/usr/lib/" 52 | mv "${pkgdir}/opt/android/hybris/lib/pkgconfig" "${pkgdir}/usr/lib/" 53 | rm -f ${pkgdir}/usr/lib/pkgconfig/{egl,glesv1_cm,glesv2,wayland-egl}.pc 54 | 55 | # create symlink to /usr/lib for every lib except those handle by package libgl, libwayland-egl 56 | find ${pkgdir}/opt/android/hybris/lib/ -type l -exec cp -a {} ${pkgdir}/usr/lib/ \; 57 | for i in $(find ${pkgdir}/opt/android/hybris/lib/ -not -type l -type f); do 58 | ln -s /opt/android/hybris/lib/$(basename $i) ${pkgdir}/usr/lib/ 59 | done 60 | for i in $(find ${pkgdir}/usr/lib/ -name 'libEGL.so*' -or -name 'libGLES*' -or -name 'libwayland-egl.so*'); do 61 | rm -f $i 62 | done 63 | } 64 | 65 | package_libhybris-libgl-git() { 66 | pkgdesc="hybris 3-D graphics library" 67 | depends=('libhybris' 'libhybris-wayland-egl-git' 'mesa-hybris') 68 | provides=('libgl') 69 | replaces=('libgl') 70 | conflicts=('libgl') 71 | 72 | install -m755 -d ${pkgdir}/usr/lib/pkgconfig 73 | cp -av ${srcdir}/fakeinstall/opt/android/hybris/lib/pkgconfig/{egl,glesv1_cm,glesv2}.pc ${pkgdir}/usr/lib/pkgconfig/ 74 | 75 | # WORKAROUND: libGL is not provided by libhybris so we use the one from mesa. 76 | # Of course it will NOT work but we need it for Xwayland used kwin_wayland. 77 | # Xwayland support should be broken and will need some analyze and fix. 78 | ln -s /usr/lib/mesa/libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so.1.2.0 79 | ln -s libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so.1 80 | ln -s libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so 81 | 82 | ln -s /opt/android/hybris/lib/libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1.0.0 83 | ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1 84 | ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so 85 | 86 | ln -s /opt/android/hybris/lib/libGLESv1_CM.so.1.0.1 ${pkgdir}/usr/lib/libGLESv1_CM.so.1.0.1 87 | ln -s libGLESv1_CM.so.1.0.1 ${pkgdir}/usr/lib/libGLESv1_CM.so.1 88 | ln -s libGLESv1_CM.so.1.0.1 ${pkgdir}/usr/lib/libGLESv1_CM.so 89 | 90 | ln -s /opt/android/hybris/lib/libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2.0.0 91 | ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2 92 | ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so 93 | 94 | } 95 | 96 | package_libhybris-wayland-egl-git() { 97 | pkgdesc="hybris 3-D wayland library" 98 | depends=('libhybris') 99 | provides=('libwayland-egl') 100 | replaces=('libwayland-egl') 101 | conflicts=('libwayland-egl') 102 | 103 | install -m755 -d ${pkgdir}/usr/lib/pkgconfig 104 | cp ${srcdir}/fakeinstall/opt/android/hybris/lib/pkgconfig/wayland-egl.pc ${pkgdir}/usr/lib/pkgconfig 105 | 106 | ln -s /opt/android/hybris/lib/libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so.1.0.0 107 | ln -s libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so.1 108 | ln -s libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so 109 | } 110 | 111 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/0001-Fix-linkage-against-shared-glapi.patch: -------------------------------------------------------------------------------- 1 | From 1b5a187c3c31513ae39cd2a917a3234c2c5f87fc Mon Sep 17 00:00:00 2001 2 | From: Adam Jackson 3 | Date: Wed, 12 Oct 2016 13:41:33 -0400 4 | Subject: [PATCH] Fix linkage against shared glapi 5 | 6 | Signed-off-by: Adam Jackson 7 | --- 8 | src/gallium/targets/osmesa/Makefile.am | 2 +- 9 | 1 files changed, 1 insertions(+), 1 deletions(-) 10 | 11 | diff --git a/src/gallium/targets/osmesa/Makefile.am b/src/gallium/targets/osmesa/Makefile.am 12 | index 5d39486..04add87 100644 13 | --- a/src/gallium/targets/osmesa/Makefile.am 14 | +++ b/src/gallium/targets/osmesa/Makefile.am 15 | @@ -63,7 +63,7 @@ lib@OSMESA_LIB@_la_LIBADD = \ 16 | $(top_builddir)/src/gallium/drivers/trace/libtrace.la \ 17 | $(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la \ 18 | $(top_builddir)/src/gallium/state_trackers/osmesa/libosmesa.la \ 19 | - $(top_builddir)/src/mapi/glapi/libglapi.la \ 20 | + $(top_builddir)/src/mapi/shared-glapi/libglapi.la \ 21 | $(SHARED_GLAPI_LIB) \ 22 | $(OSMESA_LIB_DEPS) \ 23 | $(CLOCK_LIB) 24 | -- 25 | 2.9.3 26 | 27 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/0001-glapi-Link-with-glapi-when-built-shared.patch: -------------------------------------------------------------------------------- 1 | From 16875ea5b9170f2213fd486d763f27a9d6dfc1b5 Mon Sep 17 00:00:00 2001 2 | From: Nicolas Chauvet 3 | Date: Tue, 25 Oct 2016 09:35:13 +0200 4 | Subject: [PATCH 1/3] glapi: Link with glapi when built shared 5 | 6 | This patch explicitly links to libglapi when built shared. 7 | This was specially needed to avoid undefined non-weak-symbol as shown 8 | with: 9 | 10 | ldd -r /usr/lib64/dri/i915_dri.so 11 | linux-vdso.so.1 (0x00007fff821f4000) 12 | libdrm_intel.so.1 => /lib64/libdrm_intel.so.1 (0x00007f6adf2c7000) 13 | libdrm_nouveau.so.2 => /lib64/libdrm_nouveau.so.2 (0x00007f6adf0be000) 14 | libdrm_radeon.so.1 => /lib64/libdrm_radeon.so.1 (0x00007f6adeeb2000) 15 | libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f6adec8b000) 16 | libdrm.so.2 => /lib64/libdrm.so.2 (0x00007f6adea7c000) 17 | libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f6ade84f000) 18 | libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6ade633000) 19 | libdl.so.2 => /lib64/libdl.so.2 (0x00007f6ade42f000) 20 | libm.so.6 => /lib64/libm.so.6 (0x00007f6ade125000) 21 | libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f6addf0e000) 22 | libc.so.6 => /lib64/libc.so.6 (0x00007f6addb4c000) 23 | /lib64/ld-linux-x86-64.so.2 (0x000056274e913000) 24 | libpciaccess.so.0 => /lib64/libpciaccess.so.0 (0x00007f6add941000) 25 | libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f6add6ce000) 26 | undefined symbol: _glapi_get_dispatch_table_size (/usr/lib64/dri/i915_dri.so) 27 | undefined symbol: _glapi_get_context (/usr/lib64/dri/i915_dri.so) 28 | undefined symbol: _glapi_add_dispatch (/usr/lib64/dri/i915_dri.so) 29 | undefined symbol: _glapi_check_multithread (/usr/lib64/dri/i915_dri.so) 30 | undefined symbol: _glapi_tls_Context (/usr/lib64/dri/i915_dri.so) 31 | undefined symbol: _glapi_set_context (/usr/lib64/dri/i915_dri.so) 32 | undefined symbol: _glapi_set_dispatch (/usr/lib64/dri/i915_dri.so) 33 | undefined symbol: _glapi_tls_Dispatch (/usr/lib64/dri/i915_dri.so) 34 | 35 | v3: Add gallium counterpart for radeon cases 36 | Reported-by: Jonathan Dieter 37 | 38 | v2: Add Bugzilla and Signed-off 39 | 40 | Fixes: 0cbc90c57c ("mesa: dri: Add shared glapi to LIBADD on Android") 41 | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98428 42 | Signed-off-by: Nicolas Chauvet 43 | --- 44 | src/gallium/targets/dri/Makefile.am | 2 -- 45 | src/mesa/drivers/dri/Makefile.am | 3 --- 46 | 2 files changed, 5 deletions(-) 47 | 48 | diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am 49 | index bca747f..05f6c8c 100644 50 | --- a/src/gallium/targets/dri/Makefile.am 51 | +++ b/src/gallium/targets/dri/Makefile.am 52 | @@ -1,10 +1,8 @@ 53 | include $(top_srcdir)/src/gallium/Automake.inc 54 | 55 | -if HAVE_ANDROID 56 | if HAVE_SHARED_GLAPI 57 | SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la 58 | endif 59 | -endif 60 | 61 | AM_CFLAGS = \ 62 | -I$(top_srcdir)/src/mapi \ 63 | diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am 64 | index 1c6dd08..8e68fc0 100644 65 | --- a/src/mesa/drivers/dri/Makefile.am 66 | +++ b/src/mesa/drivers/dri/Makefile.am 67 | @@ -6,12 +6,9 @@ MEGADRIVERS_DEPS = 68 | 69 | SUBDIRS+=common 70 | 71 | -# On Android, we need to explicitly link to libglapi.so. 72 | -if HAVE_ANDROID 73 | if HAVE_SHARED_GLAPI 74 | SHARED_GLAPI_LIB = $(top_builddir)/src/mapi/shared-glapi/libglapi.la 75 | endif 76 | -endif 77 | 78 | if HAVE_I915_DRI 79 | SUBDIRS += i915 80 | -- 81 | 2.7.4 82 | 83 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/0002-fixup-EGL-Implement-the-libglvnd-interface-for-EGL-v.patch: -------------------------------------------------------------------------------- 1 | From 2d4094c2caad6cef2f5544b3966fcc37ceb32036 Mon Sep 17 00:00:00 2001 2 | From: Kyle Brenneman 3 | Date: Thu, 5 Jan 2017 14:29:47 -0700 4 | Subject: [PATCH 2/2] fixup! EGL: Implement the libglvnd interface for EGL (v2) 5 | 6 | --- 7 | src/egl/generate/eglFunctionList.py | 6 ++++-- 8 | 1 file changed, 4 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/src/egl/generate/eglFunctionList.py b/src/egl/generate/eglFunctionList.py 11 | index b19b5f7193..80cb83437c 100644 12 | --- a/src/egl/generate/eglFunctionList.py 13 | +++ b/src/egl/generate/eglFunctionList.py 14 | @@ -53,12 +53,14 @@ method values: 15 | Select the vendor that owns the current context. 16 | """ 17 | 18 | -def _eglFunc(name, method, static=False, public=False, inheader=None, prefix="", extension=None, retval=None): 19 | +def _eglFunc(name, method, static=None, public=False, inheader=None, prefix="dispatch_", extension=None, retval=None): 20 | """ 21 | A convenience function to define an entry in the EGL function list. 22 | """ 23 | + if static is None: 24 | + static = (not public and method != "custom") 25 | if inheader is None: 26 | - inheader = (not public) 27 | + inheader = (not static) 28 | values = { 29 | "method" : method, 30 | "prefix" : prefix, 31 | -- 32 | 2.11.0 33 | 34 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/LICENSE: -------------------------------------------------------------------------------- 1 | Disclaimer 2 | 3 | Mesa is a 3-D graphics library with an API which is very similar to 4 | that of OpenGL* 5 | To the extent that Mesa utilizes the OpenGL command syntax or state 6 | machine, it is being used with authorization from Silicon Graphics, 7 | Inc.(SGI). However, the author does not possess an OpenGL license 8 | from SGI, and makes no claim that Mesa is in any way a compatible 9 | replacement for OpenGL or associated with SGI. Those who want a 10 | licensed implementation of OpenGL should contact a licensed 11 | vendor. 12 | 13 | Please do not refer to the library as MesaGL (for legal 14 | reasons). It's just Mesa or The Mesa 3-D graphics 15 | library 16 | 17 | * OpenGL is a trademark of Silicon Graphics Incorporated. 18 | 19 | License / Copyright Information 20 | 21 | The Mesa distribution consists of several components. Different copyrights 22 | and licenses apply to different components. For example, GLUT is copyrighted 23 | by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa 24 | device drivers are copyrighted by their authors. See below for a list of 25 | Mesa's main components and the license for each. 26 | 27 | The core Mesa library is licensed according to the terms of the MIT license. 28 | This allows integration with the XFree86, Xorg and DRI projects. 29 | 30 | The default Mesa license is as follows: 31 | 32 | Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a 35 | copy of this software and associated documentation files (the "Software"), 36 | to deal in the Software without restriction, including without limitation 37 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 38 | and/or sell copies of the Software, and to permit persons to whom the 39 | Software is furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included 42 | in all copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 45 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 47 | BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 48 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 49 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 50 | 51 | Attention, Contributors 52 | 53 | When contributing to the Mesa project you must agree to the licensing terms 54 | of the component to which you're contributing. 55 | The following section lists the primary components of the Mesa distribution 56 | and their respective licenses. 57 | 58 | 59 | Mesa Component Licenses 60 | 61 | Component Location Primary Author License 62 | ---------------------------------------------------------------------------- 63 | Main Mesa code src/mesa/ Brian Paul Mesa (MIT) 64 | 65 | Device drivers src/mesa/drivers/* See drivers See drivers 66 | 67 | Ext headers include/GL/glext.h SGI SGI Free B 68 | include/GL/glxext.h 69 | 70 | GLUT src/glut/ Mark Kilgard Mark's copyright 71 | 72 | Mesa GLU library src/glu/mesa/ Brian Paul GNU-LGPL 73 | 74 | SGI GLU library src/glu/sgi/ SGI SGI Free B 75 | 76 | demo programs progs/demos/ various see source files 77 | 78 | X demos progs/xdemos/ Brian Paul see source files 79 | 80 | SGI demos progs/samples/ SGI SGI copyright 81 | 82 | RedBook demos progs/redbook/ SGI SGI copyright 83 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | # based on mesa package from archlinuxarm (without libva-mesa-driver) 4 | 5 | # Maintainer: Jan de Groot 6 | # Maintainer: Andreas Radke 7 | 8 | # ALARM: Kevin Mihelich 9 | # - Removed DRI and Gallium3D drivers/packages for chipsets that don't exist in our ARM devices (intel, radeon, VMware svga). 10 | 11 | # ALARM: Michael Serpieri 12 | # - Move libwayland-egl library to a new package mesa-wayland-egl 13 | # to support different providers for libwayland-egl (eg: libhybris) in the same way than libgl 14 | # - Disable libglvnd support (need to be compatible with libhybris first) 15 | 16 | pkgbase=mesa-hybris 17 | _pkgbase=mesa 18 | pkgname=('mesa-hybris' 'mesa-hybris-libgl' 'mesa-hybris-wayland-egl') 19 | pkgver=17.0.5 20 | pkgrel=1 21 | arch=('i686' 'x86_64' 'armv7h') 22 | makedepends=('python2-mako' 'libxml2' 'libx11' 'glproto' 'libdrm' 'dri2proto' 'dri3proto' 'presentproto' 23 | 'libxshmfence' 'libxxf86vm' 'libxdamage' 'libvdpau' 'wayland' 'elfutils' 'llvm' 24 | 'libomxil-bellagio' 'clang') 25 | url="http://mesa3d.sourceforge.net" 26 | license=('custom') 27 | source=(https://mesa.freedesktop.org/archive/mesa-${pkgver}.tar.xz 28 | LICENSE 29 | remove-libpthread-stubs.patch 30 | 0001-EGL-Implement-the-libglvnd-interface-for-EGL-v2.patch 31 | 0001-Fix-linkage-against-shared-glapi.patch 32 | 0001-glapi-Link-with-glapi-when-built-shared.patch 33 | 0002-fixup-EGL-Implement-the-libglvnd-interface-for-EGL-v.patch 34 | glvnd-fix-gl-dot-pc.patch) 35 | sha256sums=('668efa445d2f57a26e5c096b1965a685733a3b57d9c736f9d6460263847f9bfe' 36 | '7fdc119cf53c8ca65396ea73f6d10af641ba41ea1dd2bd44a824726e01c8b3f2' 37 | '75ab53ad44b95204c788a2988e97a5cb963bdbf6072a5466949a2afb79821c8f' 38 | '1d3475dc2f4f3e450cf313130d3ce965f933f396058828fa843c0df8115feeb9' 39 | 'c68d1522f9bce4ce31c92aa7a688da49f13043f5bb2254795b76dea8f47130b7' 40 | '064dcd5a3ab1b7c23383e2cafbd37859e4c353f8839671d9695c6f7c2ef3260b' 41 | '81d0ced62f61677ea0cf5f69a491093409fa1370f2ef045c41106ca8bf9c46f6' 42 | '64a77944a28026b066c1682c7258d02289d257b24b6f173a9f7580c48beed966') 43 | validpgpkeys=('8703B6700E7EE06D7A39B8D6EDAE37B02CEB490D') # Emil Velikov 44 | validpgpkeys+=('946D09B5E4C9845E63075FF1D961C596A7203456') # "Andres Gomez " 45 | 46 | prepare() { 47 | cd ${srcdir}/mesa-${pkgver} 48 | 49 | # Now mesa checks for libpthread-stubs - so remove the check 50 | patch -Np1 -i ../remove-libpthread-stubs.patch 51 | 52 | # glvnd support patches - from Fedora 53 | # https://patchwork.freedesktop.org/series/12354/, v3 & v4 54 | patch -Np1 -i ../0001-EGL-Implement-the-libglvnd-interface-for-EGL-v2.patch 55 | patch -Np1 -i ../0002-fixup-EGL-Implement-the-libglvnd-interface-for-EGL-v.patch 56 | # non-upstreamed ones 57 | patch -Np1 -i ../glvnd-fix-gl-dot-pc.patch 58 | patch -Np1 -i ../0001-Fix-linkage-against-shared-glapi.patch 59 | patch -Np1 -i ../0001-glapi-Link-with-glapi-when-built-shared.patch 60 | 61 | autoreconf -fiv 62 | } 63 | 64 | build() { 65 | cd ${srcdir}/mesa-${pkgver} 66 | 67 | [[ $CARCH == "armv7h" ]] && GALLIUM=",etnaviv,imx" 68 | 69 | ./configure --prefix=/usr \ 70 | --sysconfdir=/etc \ 71 | --with-dri-driverdir=/usr/lib/xorg/modules/dri \ 72 | --with-gallium-drivers=freedreno,nouveau,swrast,virgl,vc4${GALLIUM} \ 73 | --with-dri-drivers=nouveau,swrast \ 74 | --with-egl-platforms=x11,drm,wayland \ 75 | --disable-xvmc \ 76 | --enable-gallium-llvm \ 77 | --enable-llvm-shared-libs \ 78 | --enable-shared-glapi \ 79 | --disable-libglvnd \ 80 | --enable-egl \ 81 | --enable-glx \ 82 | --enable-glx-tls \ 83 | --enable-gles1 \ 84 | --enable-gles2 \ 85 | --enable-gbm \ 86 | --enable-dri \ 87 | --enable-gallium-osmesa \ 88 | --enable-texture-float \ 89 | --enable-omx \ 90 | --enable-nine \ 91 | --with-clang-libdir=/usr/lib 92 | #--with-sha1=libgcrypt \ 93 | 94 | make 95 | 96 | # fake installation 97 | mkdir $srcdir/fakeinstall 98 | make DESTDIR=${srcdir}/fakeinstall install 99 | } 100 | 101 | package_mesa-hybris() { 102 | pkgdesc="an open-source implementation of the OpenGL specification" 103 | depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf' 104 | 'libomxil-bellagio' 'libtxc_dxtn' 'llvm-libs') 105 | optdepends=('opengl-man-pages: for the OpenGL API man pages' 106 | 'mesa-vdpau: for accelerated video playback' 107 | 'libva-mesa-driver: for accelerated video playback') 108 | provides=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri' 'opengl-driver' 'mesa') 109 | conflicts=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri' 'mesa-libgl' 'mesa' 'libglvnd') 110 | replaces=('ati-dri' 'intel-dri' 'nouveau-dri' 'svga-dri' 'mesa-dri' 'mesa') 111 | 112 | install -m755 -d ${pkgdir}/etc 113 | cp -rv ${srcdir}/fakeinstall/etc/drirc ${pkgdir}/etc 114 | 115 | #install -m755 -d ${pkgdir}/usr/share/glvnd/egl_vendor.d 116 | #cp -rv ${srcdir}/fakeinstall/usr/share/glvnd/egl_vendor.d/50_mesa.json ${pkgdir}/usr/share/glvnd/egl_vendor.d/ 117 | 118 | install -m755 -d ${pkgdir}/usr/lib/xorg/modules/dri 119 | # ati-dri, nouveau-dri, intel-dri, svga-dri, swrast 120 | cp -av ${srcdir}/fakeinstall/usr/lib/xorg/modules/dri/* ${pkgdir}/usr/lib/xorg/modules/dri 121 | 122 | cp -rv ${srcdir}/fakeinstall/usr/lib/bellagio ${pkgdir}/usr/lib 123 | cp -rv ${srcdir}/fakeinstall/usr/lib/d3d ${pkgdir}/usr/lib 124 | cp -rv ${srcdir}/fakeinstall/usr/lib/lib{gbm,glapi}.so* ${pkgdir}/usr/lib/ 125 | cp -rv ${srcdir}/fakeinstall/usr/lib/libOSMesa.so* ${pkgdir}/usr/lib/ 126 | 127 | cp -rv ${srcdir}/fakeinstall/usr/include ${pkgdir}/usr 128 | cp -rv ${srcdir}/fakeinstall/usr/lib/pkgconfig ${pkgdir}/usr/lib/ 129 | rm ${pkgdir}/usr/lib/pkgconfig/{egl,gl,glesv1_cm,glesv2,wayland-egl}.pc 130 | 131 | # remove vulkan headers 132 | rm -rf ${pkgdir}/usr/include/vulkan 133 | 134 | ## libglvnd support 135 | #cp -rv ${srcdir}/fakeinstall/usr/lib/libGLX_mesa.so* ${pkgdir}/usr/lib/ 136 | #cp -rv ${srcdir}/fakeinstall/usr/lib/libEGL_mesa.so* ${pkgdir}/usr/lib/ 137 | ## indirect rendering 138 | #ln -s /usr/lib/libGLX_mesa.so.0 ${pkgdir}/usr/lib/libGLX_indirect.so.0 139 | 140 | install -m755 -d ${pkgdir}/usr/lib/mesa 141 | # move libgl/EGL/glesv*.so to not conflict with blobs - may break .pc files ? 142 | cp -rv ${srcdir}/fakeinstall/usr/lib/libGL.so* ${pkgdir}/usr/lib/mesa/ 143 | cp -rv ${srcdir}/fakeinstall/usr/lib/libEGL.so* ${pkgdir}/usr/lib/mesa/ 144 | cp -rv ${srcdir}/fakeinstall/usr/lib/libGLES*.so* ${pkgdir}/usr/lib/mesa/ 145 | # move libwayland*.so* to not conflict with other providers like libhybris - may break .pc files ? 146 | cp -rv ${srcdir}/fakeinstall/usr/lib/libwayland*.so* ${pkgdir}/usr/lib/mesa/ 147 | 148 | install -m755 -d "${pkgdir}/usr/share/licenses/mesa" 149 | install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/mesa/" 150 | } 151 | 152 | package_mesa-hybris-libgl() { 153 | pkgdesc="Mesa 3-D graphics library" 154 | depends=('mesa-hybris' 'mesa-hybris-wayland-egl') 155 | provides=('libgl') 156 | replaces=('libgl') 157 | conflicts=('libgl' 'libglvnd') 158 | 159 | install -m755 -d ${pkgdir}/usr/lib/pkgconfig 160 | cp ${srcdir}/fakeinstall/usr/lib/pkgconfig/{egl,gl,glesv1_cm,glesv2}.pc ${pkgdir}/usr/lib/pkgconfig 161 | 162 | # See FS#26284 163 | install -m755 -d "${pkgdir}/usr/lib/xorg/modules/extensions" 164 | ln -s libglx.xorg "${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so" 165 | 166 | ln -s /usr/lib/mesa/libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so.1.2.0 167 | ln -s libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so.1 168 | ln -s libGL.so.1.2.0 ${pkgdir}/usr/lib/libGL.so 169 | 170 | ln -s /usr/lib/mesa/libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1.0.0 171 | ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so.1 172 | ln -s libEGL.so.1.0.0 ${pkgdir}/usr/lib/libEGL.so 173 | 174 | ln -s /usr/lib/mesa/libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib/libGLESv1_CM.so.1.1.0 175 | ln -s libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib/libGLESv1_CM.so.1 176 | ln -s libGLESv1_CM.so.1.1.0 ${pkgdir}/usr/lib/libGLESv1_CM.so 177 | 178 | ln -s /usr/lib/mesa/libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2.0.0 179 | ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so.2 180 | ln -s libGLESv2.so.2.0.0 ${pkgdir}/usr/lib/libGLESv2.so 181 | 182 | install -m755 -d "${pkgdir}/usr/share/licenses/mesa-libgl" 183 | install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/mesa-libgl/" 184 | } 185 | 186 | package_mesa-hybris-wayland-egl() { 187 | pkgdesc="Mesa 3-D wayland library" 188 | depends=('mesa-hybris') 189 | provides=('libwayland-egl') 190 | replaces=('libwayland-egl') 191 | conflicts=('libwayland-egl') 192 | 193 | install -m755 -d ${pkgdir}/usr/lib/pkgconfig 194 | cp ${srcdir}/fakeinstall/usr/lib/pkgconfig/wayland-egl.pc ${pkgdir}/usr/lib/pkgconfig 195 | 196 | ln -s /usr/lib/mesa/libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so.1.0.0 197 | ln -s libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so.1 198 | ln -s libwayland-egl.so.1.0.0 ${pkgdir}/usr/lib/libwayland-egl.so 199 | } 200 | 201 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/glvnd-fix-gl-dot-pc.patch: -------------------------------------------------------------------------------- 1 | diff -up mesa-12.0.3/src/mesa/gl.pc.in.jx mesa-12.0.3/src/mesa/gl.pc.in 2 | --- mesa-12.0.3/src/mesa/gl.pc.in.jx 2016-01-18 02:39:26.000000000 -0500 3 | +++ mesa-12.0.3/src/mesa/gl.pc.in 2016-10-25 13:06:44.013159358 -0400 4 | @@ -7,7 +7,7 @@ Name: gl 5 | Description: Mesa OpenGL library 6 | Requires.private: @GL_PC_REQ_PRIV@ 7 | Version: @PACKAGE_VERSION@ 8 | -Libs: -L${libdir} -l@GL_LIB@ 9 | +Libs: -L${libdir} -lGL 10 | Libs.private: @GL_PC_LIB_PRIV@ 11 | Cflags: -I${includedir} @GL_PC_CFLAGS@ 12 | glx_tls: @GLX_TLS@ 13 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/mesa-hybris/remove-libpthread-stubs.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure.ac b/configure.ac 2 | index 54416b4..8a708d3 100644 3 | --- a/configure.ac 4 | +++ b/configure.ac 5 | @@ -824,7 +824,7 @@ test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread" 6 | 7 | dnl pthread-stubs is mandatory on targets where it exists 8 | case "$host_os" in 9 | -cygwin* ) 10 | +cygwin* | linux* ) 11 | pthread_stubs_possible="no" 12 | ;; 13 | * ) 14 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/qt5-qpa-hwcomposer-plugin/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | pkgname=qt5-qpa-hwcomposer-plugin 4 | conflicts=('qt') 5 | _pkgname=qt5-qpa-hwcomposer-plugin 6 | _qtver=5.8.0 7 | pkgver=${_qtver/-/} 8 | pkgrel=1 9 | arch=('i686' 'x86_64' 'armv7h') 10 | url='https://github.com/mer-hybris/qt5-qpa-hwcomposer-plugin' 11 | license=('GPL3' 'LGPL' 'custom') 12 | pkgdesc='Qt QPA plugin for Android hwcomposer' 13 | depends=('qt5-base' 'qt5-wayland-hybris' 'hybris-android-headers' 'libhybris') 14 | makedepends=() 15 | source=(${_pkgname}::git+http://github.com/mickybart/qt5-qpa-hwcomposer-plugin.git#tag=v${_qtver}) 16 | md5sums=('SKIP') 17 | 18 | prepare() { 19 | mkdir -p build 20 | } 21 | 22 | build() { 23 | cd build 24 | 25 | qmake ../${_pkgname}/hwcomposer/ 26 | make 27 | } 28 | 29 | package() { 30 | cd build 31 | 32 | make INSTALL_ROOT="$pkgdir" install 33 | } 34 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/qt5-qpa-surfaceflinger-plugin/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | pkgname=qt5-qpa-surfaceflinger-plugin 4 | conflicts=('qt') 5 | _pkgname=qt5-qpa-surfaceflinger-plugin 6 | _qtver=5.8.0 7 | pkgver=${_qtver/-/} 8 | pkgrel=1 9 | arch=('i686' 'x86_64' 'armv7h') 10 | url='https://github.com/mickybart/qt5-qpa-surfaceflinger-plugin' 11 | license=('GPL3' 'LGPL' 'custom') 12 | pkgdesc='Qt QPA plugin for Android SurfaceFlinger' 13 | depends=('qt5-base' 'qt5-wayland-hybris' 'hybris-android-headers' 'libhybris') 14 | makedepends=() 15 | source=(${_pkgname}::git+http://github.com/mickybart/qt5-qpa-surfaceflinger-plugin.git#tag=v${_qtver}) 16 | md5sums=('SKIP') 17 | 18 | prepare() { 19 | mkdir -p build 20 | } 21 | 22 | build() { 23 | cd build 24 | 25 | qmake ../${_pkgname}/surfaceflinger/ 26 | make 27 | } 28 | 29 | package() { 30 | cd build 31 | 32 | make INSTALL_ROOT="$pkgdir" install 33 | } 34 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/PKGBUILD: -------------------------------------------------------------------------------- 1 | # $Id: PKGBUILD 165989 2016-03-10 18:49:59Z spupykin $ 2 | # Maintainer: Michael Serpieri 3 | # Contributor: Sergej Pupykin 4 | # Contributor: Andreas Wagner 5 | 6 | pkgbase=schroot-hybris 7 | _pkgbase=schroot 8 | pkgname=('schroot-hybris' 'schroot-droid') 9 | pkgver=1.6.10 10 | pkgrel=15 11 | url="http://packages.qa.debian.org/s/schroot.html" 12 | license=('GPL3') 13 | makedepends=('boost' 'cppunit') 14 | arch=('i686' 'x86_64' 'armv7h') 15 | source=("http://ftp.debian.org/debian/pool/main/s/$_pkgbase/${_pkgbase}_${pkgver}.orig.tar.xz" 16 | "http://http.debian.net/debian/pool/main/s/schroot/schroot_$pkgver-2~bpo8+1.debian.tar.xz" 17 | 'arch32-example' 18 | 'arch32-config' 19 | 'arch32-copyfiles' 20 | 'arch32-mount' 21 | 'arch32-nssdatabases' 22 | 'pam.d.schroot.patch' 23 | 'fix-bash-completion.patch' 24 | 'android-environment-schroot.patch' 25 | 'gls-common::git+https://github.com/mickybart/gnulinux_support-common') 26 | md5sums=('f8ec667831487f4b12e094bc0dc9bbe3' 27 | '7ec5bf0d455a803b2885041754c3a3aa' 28 | '54239847f89b9a4772910415bde6276a' 29 | '5a3f7b839c7e0b8933748da7c5b6385b' 30 | 'ddb2f09c02b24dab777110f9808472e1' 31 | 'f0d5d5b5e34a860f6f90b5628c680f46' 32 | 'af1da6edd8c8c0dafeeb2c2c4e0c840b' 33 | 'a8d77cac806a0a9adef3f93cdbeb280a' 34 | '5ba775d4f401e2c167414caa548b71e5' 35 | '532a4f1abdb479ba569cc7e23e53d69c' 36 | 'SKIP') 37 | 38 | prepare() { 39 | cd ${_pkgbase}-${pkgver} 40 | patch -p1 -i "${srcdir}"/fix-bash-completion.patch 41 | cat "$srcdir"/debian/patches/series | while read p; do 42 | patch -p1 -i "$srcdir"/debian/patches/$p 43 | done 44 | patch -p1 -i "${srcdir}"/android-environment-schroot.patch 45 | ./bootstrap 46 | } 47 | 48 | build() { 49 | cd ${_pkgbase}-${pkgver} 50 | export LDFLAGS="${LDFLAGS//-Wl,--as-needed}" 51 | ./configure \ 52 | --prefix=/usr \ 53 | --libexecdir=/usr/lib \ 54 | --sysconfdir=/etc \ 55 | --localstatedir=/var \ 56 | --enable-dchroot \ 57 | --enable-lvm-snapshot \ 58 | --enable-btrfs-snapshot \ 59 | --with-bash-completion-dir=/usr/share/bash-completion/completions/ \ 60 | BTRFS=/sbin/btrfs \ 61 | BTRFSCTL=/sbin/btrfsctl \ 62 | LVCREATE=/sbin/lvcreate \ 63 | LVREMOVE=/sbin/lvremove 64 | # --enable-csbuild 65 | make 66 | } 67 | 68 | check() { 69 | cd ${_pkgbase}-${pkgver} 70 | # make -k check 71 | } 72 | 73 | package_schroot-hybris() { 74 | pkgdesc="Allows users to execute shell commands under different root filesystems. (Successor to dchroot)." 75 | depends=('pam' 'lockdev' 'boost-libs' 'e2fsprogs') 76 | optdepends=('btrfs-progs-unstable' 'lvm2') 77 | conflicts=('dchroot' 'schroot' 'schroot-android') 78 | replaces=('dchroot' 'schroot' 'schroot-android') 79 | provides=('schroot' 'sbuild' 'dchroot' 'schroot-android') 80 | backup=('etc/schroot/schroot.conf' 81 | 'etc/schroot/arch32/config' 82 | 'etc/schroot/arch32/copyfiles' 83 | 'etc/schroot/arch32/mount' 84 | 'etc/schroot/arch32/nssdatabases') 85 | 86 | cd ${_pkgbase}-${pkgver} 87 | make DESTDIR="$pkgdir" install 88 | install -dm 755 "${pkgdir}"/etc/schroot/arch32 89 | install -m 644 "${srcdir}"/arch32-{config,mount,copyfiles,nssdatabases} "${pkgdir}"/etc/schroot/arch32 90 | rename 'arch32-' '' "${pkgdir}"/etc/schroot/arch32/* 91 | install -m 644 "${srcdir}"/arch32-example "${pkgdir}"/etc/schroot/chroot.d/arch32.conf.example 92 | patch -i "${srcdir}"/pam.d.schroot.patch "${pkgdir}"/etc/pam.d/schroot 93 | 94 | install -dm 755 "${pkgdir}"/usr/share/schroot/examples/ 95 | cp -a "${srcdir}"/gls-common/schroot/android-example "${pkgdir}"/usr/share/schroot/examples/android 96 | } 97 | 98 | package_schroot-droid() { 99 | pkgdesc="Allow user to interact with Android chroot easily" 100 | depends=('schroot-hybris') 101 | 102 | install -d "${pkgdir}"/usr/bin 103 | install -m 755 "${srcdir}"/gls-common/schroot/sdroid "${pkgdir}"/usr/bin/ 104 | 105 | install -d "${pkgdir}"/usr/lib/tmpfiles.d/ 106 | install -m 644 "${srcdir}"/gls-common/schroot/config/tmpfiles.d.schroot-droid.conf "${pkgdir}"/usr/lib/tmpfiles.d/schroot-droid.conf 107 | 108 | } 109 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/android-environment-schroot.patch: -------------------------------------------------------------------------------- 1 | diff --git a/bin/dchroot/dchroot-options.cc b/bin/dchroot/dchroot-options.cc 2 | index 4b95814..e9713fa 100644 3 | --- a/bin/dchroot/dchroot-options.cc 4 | +++ b/bin/dchroot/dchroot-options.cc 5 | @@ -59,7 +59,9 @@ options::add_options () 6 | ("directory", opt::value(&this->directory), 7 | _("Directory to use")) 8 | ("preserve-environment,d", 9 | - _("Preserve user environment")); 10 | + _("Preserve user environment")) 11 | + ("android-environment,g", 12 | + _("Set Android environment")); 13 | } 14 | 15 | void 16 | @@ -84,6 +86,8 @@ options::check_options () 17 | 18 | if (vm.count("preserve-environment")) 19 | this->preserve = true; 20 | + if (vm.count("android-environment")) 21 | + this->android = true; 22 | 23 | if (this->quiet && this->verbose) 24 | { 25 | diff --git a/bin/dchroot/dchroot-session.cc b/bin/dchroot/dchroot-session.cc 26 | index 5c13fe6..a150bda 100644 27 | --- a/bin/dchroot/dchroot-session.cc 28 | +++ b/bin/dchroot/dchroot-session.cc 29 | @@ -56,6 +56,12 @@ session::get_login_directories (sbuild::chroot::ptr& session_chroot, 30 | sbuild::environment const& env) const 31 | { 32 | sbuild::string_list ret; 33 | + 34 | + if (get_android_environment() || session_chroot->get_android_environment()) { 35 | + //Always use / for android because it is not compliant with FHS 36 | + ret.push_back("/"); 37 | + return ret; 38 | + } 39 | 40 | std::string const& wd(get_auth()->get_wd()); 41 | if (!wd.empty()) 42 | diff --git a/bin/schroot/schroot-main-base.cc b/bin/schroot/schroot-main-base.cc 43 | index b09a83e..f838a7d 100644 44 | --- a/bin/schroot/schroot-main-base.cc 45 | +++ b/bin/schroot/schroot-main-base.cc 46 | @@ -369,6 +369,7 @@ main_base::run_impl () 47 | if (!this->options->shell.empty()) 48 | this->session->set_shell_override(this->options->shell); 49 | this->session->set_preserve_environment(this->options->preserve); 50 | + this->session->set_android_environment(this->options->android); 51 | this->session->set_session_id(this->options->session_name); 52 | this->session->set_force(this->options->session_force); 53 | if (this->options->quiet) 54 | diff --git a/bin/schroot/schroot-options-base.cc b/bin/schroot/schroot-options-base.cc 55 | index 39199ea..3d6c11a 100644 56 | --- a/bin/schroot/schroot-options-base.cc 57 | +++ b/bin/schroot/schroot-options-base.cc 58 | @@ -53,6 +53,7 @@ options_base::options_base (): 59 | shell(), 60 | user(), 61 | preserve(false), 62 | + android(false), 63 | all(false), 64 | all_chroots(false), 65 | all_sessions(false), 66 | diff --git a/bin/schroot/schroot-options-base.h b/bin/schroot/schroot-options-base.h 67 | index da5ac3d..79cccb4 100644 68 | --- a/bin/schroot/schroot-options-base.h 69 | +++ b/bin/schroot/schroot-options-base.h 70 | @@ -92,6 +92,8 @@ namespace schroot 71 | std::string user; 72 | /// Preserve environment. 73 | bool preserve; 74 | + /// Android environment. 75 | + bool android; 76 | /// Use all chroots and sessions. 77 | bool all; 78 | /// Use all chroots. 79 | diff --git a/bin/schroot/schroot-options.cc b/bin/schroot/schroot-options.cc 80 | index de99c5e..c56a48c 100644 81 | --- a/bin/schroot/schroot-options.cc 82 | +++ b/bin/schroot/schroot-options.cc 83 | @@ -72,6 +72,8 @@ options::add_options () 84 | _("Username (default current user)")) 85 | ("preserve-environment,p", 86 | _("Preserve user environment")) 87 | + ("android-environment,g", 88 | + _("Set Android environment")) 89 | ("option,o", opt::value(&this->useroptions), 90 | _("Set option")); 91 | 92 | @@ -117,6 +119,8 @@ options::check_options () 93 | 94 | if (vm.count("preserve-environment")) 95 | this->preserve = true; 96 | + if (vm.count("android-environment")) 97 | + this->android = true; 98 | 99 | if (vm.count("automatic-session")) 100 | this->action = ACTION_SESSION_AUTO; 101 | diff --git a/etc/setup.d/50chrootname b/etc/setup.d/50chrootname 102 | index 4b51b5f..52576f1 100755 103 | --- a/etc/setup.d/50chrootname 104 | +++ b/etc/setup.d/50chrootname 105 | @@ -23,6 +23,11 @@ set -e 106 | . "$SETUP_DATA_DIR/common-functions" 107 | . "$SETUP_DATA_DIR/common-config" 108 | 109 | +if [ "$SYSTEMTARGET" == "android" ]; then 110 | + #Doesn't apply to Android so simply exit 111 | + exit 0 112 | +fi 113 | + 114 | if [ $STAGE = "setup-start" ] || [ $STAGE = "setup-recover" ]; then 115 | 116 | info "Setting chroot name to ${CHROOT_NAME}" 117 | diff --git a/man/dchroot.1.man b/man/dchroot.1.man 118 | index 7798d29..d52cdfd 100644 119 | --- a/man/dchroot.1.man 120 | +++ b/man/dchroot.1.man 121 | @@ -27,6 +27,7 @@ dchroot \- enter a chroot environment 122 | .RB " \[or] " \-\-config " \[or] " \-\-location ] 123 | .RB [ "\-\-directory=\fIdirectory\fP" ] 124 | .RB [ \-d \[or] \-\-preserve\-environment ] 125 | +.RB [ \-g \[or] \-\-android\-environment ] 126 | .RB [ \-q \[or] \-\-quiet " \[or] " \-v \[or] \-\-verbose ] 127 | .RB [ "\-c \fIchroot\fP" \[or] "\-\-chroot=\fIchroot\fP" 128 | .RB " \[or] " \-\-all ] 129 | @@ -104,6 +105,12 @@ Preserve the user's environment inside the chroot environment. The default is 130 | to use a clean environment; this option copies the entire user environment and 131 | sets it in the session. 132 | .TP 133 | +.BR \-g ", " \-\-android\-environment 134 | +Set Android environment (eg: init.environ.rc) inside the chroot environment. 135 | +This option will set ANDROID_ROOT, LD_LIBRARY_PATH, PATH, LD_PRELOAD and PS1. 136 | +Override same defined variables if \fI\-\-preserve\-environment\fP is used. 137 | +HOME of the user will be override to root as Android doesn't follow LHS. 138 | +.TP 139 | .BR \-q ", " \-\-quiet 140 | Print only essential messages. 141 | .TP 142 | diff --git a/man/schroot.1.man b/man/schroot.1.man 143 | index db86aed..5928a3c 100644 144 | --- a/man/schroot.1.man 145 | +++ b/man/schroot.1.man 146 | @@ -33,6 +33,7 @@ schroot \- securely enter a chroot environment 147 | .RB [ "\-d \fIdirectory\fP" \[or] "\-\-directory=\fIdirectory\fP" ] 148 | .RB [ "\-u \fIuser\fP" \[or] "\-\-user=\fIuser\fP" ] 149 | .RB [ \-p \[or] \-\-preserve\-environment ] 150 | +.RB [ \-g \[or] \-\-android\-environment ] 151 | .RB [ "\-s \fIshell\fP" \[or] "\-\-shell=\fIshell\fP" ] 152 | .RB [ \-q \[or] \-\-quiet " \[or] " \-v \[or] \-\-verbose ] 153 | .RB [ "\-c \fIchroot\fP" \[or] "\-\-chroot=\fIchroot\fP" 154 | @@ -203,6 +204,12 @@ to use a clean environment; this option copies the entire user environment and 155 | sets it in the session. The environment variables allowed are subject to 156 | certain restrictions; see the section \[lq]\fIEnvironment\fP\[rq], below. 157 | .TP 158 | +.BR \-g ", " \-\-android\-environment 159 | +Set Android environment (eg: init.environ.rc) inside the chroot environment. 160 | +This option will set ANDROID_ROOT, LD_LIBRARY_PATH, PATH, LD_PRELOAD and PS1. 161 | +Override same defined variables if \fI\-\-preserve\-environment\fP is used. 162 | +HOME of the user will be override to root as Android doesn't follow LHS. 163 | +.TP 164 | .BR \-s ", " \-\-shell=\fIshell\fP 165 | Use \fIshell\fP as the login shell. When running a login shell a number of 166 | potential shells will be considered, in this order: the command in the SHELL 167 | diff --git a/man/schroot.conf.5.man b/man/schroot.conf.5.man 168 | index a5bf0ed..388711d 100644 169 | --- a/man/schroot.conf.5.man 170 | +++ b/man/schroot.conf.5.man 171 | @@ -219,6 +219,14 @@ environment. This is useful for example when running X applications inside the 172 | chroot, which need the environment to function correctly. The environment may 173 | also be preserved using the \fI\-\-preserve\-environment\fP option. 174 | .TP 175 | +\f[CBI]android\-environment=\fP\f[CI]true\fP|\f[CI]false\fP 176 | +Set to \f[CI]true\fP to export Android environment inside the chroot. That will 177 | +permit to define ANDROID_ROOT, LD_LIBRARY_PATH, PATH, LD_PRELOAD and PS1 for 178 | +Android in a similar way that is done on Android init by init.environ.rc file. 179 | +The home of the user will always be set to root as Android doesn't follow LHS. 180 | +Those variables are hard defined so you can safely use in same time 181 | +\fI\-\-environment\-filter\fP and \fI\-\-preserve\-environment\fP if needed. 182 | +.TP 183 | \f[CBI]shell=\fP\f[CI]shell\fP 184 | When running a login shell a number of potential shells will be considered, in 185 | this order: the command in the SHELL environment variable (if 186 | diff --git a/sbuild/sbuild-chroot.cc b/sbuild/sbuild-chroot.cc 187 | index 8f31e9f..d502734 100644 188 | --- a/sbuild/sbuild-chroot.cc 189 | +++ b/sbuild/sbuild-chroot.cc 190 | @@ -114,6 +114,7 @@ sbuild::chroot::chroot (): 191 | root_groups(), 192 | aliases(), 193 | preserve_environment(false), 194 | + android_environment(false), 195 | default_shell(), 196 | environment_filter(SBUILD_DEFAULT_ENVIRONMENT_FILTER), 197 | mount_location(), 198 | @@ -142,6 +143,7 @@ sbuild::chroot::chroot (const chroot& rhs): 199 | root_groups(rhs.root_groups), 200 | aliases(rhs.aliases), 201 | preserve_environment(rhs.preserve_environment), 202 | + android_environment(rhs.android_environment), 203 | default_shell(rhs.default_shell), 204 | environment_filter(rhs.environment_filter), 205 | mount_location(rhs.mount_location), 206 | @@ -356,6 +358,18 @@ sbuild::chroot::set_preserve_environment (bool preserve_environment) 207 | this->preserve_environment = preserve_environment; 208 | } 209 | 210 | +bool 211 | +sbuild::chroot::get_android_environment () const 212 | +{ 213 | + return this->android_environment; 214 | +} 215 | + 216 | +void 217 | +sbuild::chroot::set_android_environment (bool android_environment) 218 | +{ 219 | + this->android_environment = android_environment; 220 | +} 221 | + 222 | std::string const& 223 | sbuild::chroot::get_default_shell () const 224 | { 225 | @@ -678,6 +692,7 @@ sbuild::chroot::get_details (chroot const& chroot, 226 | .add(_("Root Groups"), chroot.get_root_groups()) 227 | .add(_("Aliases"), chroot.get_aliases()) 228 | .add(_("Preserve Environment"), chroot.get_preserve_environment()) 229 | + .add(_("Android Environment"), chroot.get_android_environment()) 230 | .add(_("Default Shell"), chroot.get_default_shell()) 231 | .add(_("Environment Filter"), chroot.get_environment_filter()) 232 | .add(_("Run Setup Scripts"), chroot.get_run_setup_scripts()) 233 | @@ -800,6 +815,10 @@ sbuild::chroot::get_keyfile (chroot const& chroot, 234 | keyfile::set_object_value(chroot, &chroot::get_preserve_environment, 235 | keyfile, chroot.get_name(), 236 | "preserve-environment"); 237 | + 238 | + keyfile::set_object_value(chroot, &chroot::get_android_environment, 239 | + keyfile, chroot.get_name(), 240 | + "android-environment"); 241 | 242 | keyfile::set_object_value(chroot, &chroot::get_default_shell, 243 | keyfile, chroot.get_name(), 244 | @@ -1032,6 +1051,12 @@ sbuild::chroot::set_keyfile (chroot& chroot, 245 | "preserve-environment", 246 | keyfile::PRIORITY_OPTIONAL); 247 | used_keys.push_back("preserve-environment"); 248 | + 249 | + keyfile::get_object_value(chroot, &chroot::set_android_environment, 250 | + keyfile, chroot.get_name(), 251 | + "android-environment", 252 | + keyfile::PRIORITY_OPTIONAL); 253 | + used_keys.push_back("android-environment"); 254 | 255 | keyfile::get_object_value(chroot, &chroot::set_default_shell, 256 | keyfile, chroot.get_name(), 257 | diff --git a/sbuild/sbuild-chroot.h b/sbuild/sbuild-chroot.h 258 | index ba7271c..b4e5dde 100644 259 | --- a/sbuild/sbuild-chroot.h 260 | +++ b/sbuild/sbuild-chroot.h 261 | @@ -323,6 +323,22 @@ namespace sbuild 262 | */ 263 | void 264 | set_preserve_environment (bool preserve_environment); 265 | + 266 | + /** 267 | + * Check if the Android environment should be set in the chroot. 268 | + * 269 | + * @returns true to set or false if not. 270 | + */ 271 | + bool 272 | + get_android_environment () const; 273 | + 274 | + /** 275 | + * Set if the Android environment should be set in the chroot. 276 | + * 277 | + * @param android_environment true to set or false if not. 278 | + */ 279 | + void 280 | + set_android_environment (bool android_environment); 281 | 282 | /** 283 | * Get default shell. 284 | @@ -809,6 +825,8 @@ namespace sbuild 285 | string_list aliases; 286 | /// Preserve environment? 287 | bool preserve_environment; 288 | + /// Android environment? 289 | + bool android_environment; 290 | /// Default shell 291 | std::string default_shell; 292 | /// Environment filter regex. 293 | diff --git a/sbuild/sbuild-environment.cc b/sbuild/sbuild-environment.cc 294 | index e1e95b6..f4c0c19 100644 295 | --- a/sbuild/sbuild-environment.cc 296 | +++ b/sbuild/sbuild-environment.cc 297 | @@ -27,12 +27,14 @@ using namespace sbuild; 298 | 299 | environment::environment (): 300 | std::map(), 301 | - filter() 302 | + filter(), 303 | + filter_off(false) 304 | { 305 | } 306 | 307 | environment::environment (char **environment): 308 | - std::map() 309 | + std::map(), 310 | + filter_off(false) 311 | { 312 | add(environment); 313 | } 314 | @@ -54,6 +56,12 @@ environment::get_filter () const 315 | } 316 | 317 | void 318 | +environment::use_filter (bool on) 319 | +{ 320 | + filter_off = !on; 321 | +} 322 | + 323 | +void 324 | environment::add (char **environment) 325 | { 326 | if (environment) 327 | @@ -96,7 +104,8 @@ environment::add (value_type const& value) 328 | remove(value); 329 | if (!value.first.empty() && !value.second.empty()) 330 | { 331 | - if (this->filter.str().empty() || 332 | + if (this->filter_off || 333 | + this->filter.str().empty() || 334 | !regex_search(value.first, this->filter)) 335 | { 336 | insert(value); 337 | diff --git a/sbuild/sbuild-environment.h b/sbuild/sbuild-environment.h 338 | index bd61e7b..a358fb3 100644 339 | --- a/sbuild/sbuild-environment.h 340 | +++ b/sbuild/sbuild-environment.h 341 | @@ -73,6 +73,14 @@ namespace sbuild 342 | */ 343 | regex const& 344 | get_filter () const; 345 | + 346 | + /** 347 | + * Enable/disable filter 348 | + * 349 | + * @param on enable if true, disable if false 350 | + */ 351 | + void 352 | + use_filter (bool on); 353 | 354 | /** 355 | * Add environment variables. Any existing variables sharing the 356 | @@ -313,6 +321,8 @@ namespace sbuild 357 | private: 358 | /// Filter regex. 359 | regex filter; 360 | + /// Enable/Disable filter 361 | + bool filter_off; 362 | }; 363 | 364 | } 365 | diff --git a/sbuild/sbuild-session.cc b/sbuild/sbuild-session.cc 366 | index f12257d..a0a30c2 100644 367 | --- a/sbuild/sbuild-session.cc 368 | +++ b/sbuild/sbuild-session.cc 369 | @@ -213,6 +213,7 @@ session::session (std::string const& service, 370 | termios_ok(false), 371 | verbosity(), 372 | preserve_environment(false), 373 | + android_environment(false), 374 | shell(), 375 | user_options(), 376 | cwd(sbuild::getcwd()) 377 | @@ -295,6 +296,35 @@ session::set_preserve_environment (bool preserve_environment) 378 | this->preserve_environment = preserve_environment; 379 | } 380 | 381 | +bool 382 | +session::get_android_environment () const 383 | +{ 384 | + return this->android_environment; 385 | +} 386 | + 387 | +void 388 | +session::set_android_environment (bool android_environment) 389 | +{ 390 | + this->android_environment = android_environment; 391 | +} 392 | + 393 | +void 394 | +session::setup_android_env (environment &env) 395 | +{ 396 | + /* We need to disable env filter to be sure that 397 | + * LD_.* will not be filtered (LD_.* is part of the default filter) 398 | + */ 399 | + env.use_filter(false); 400 | + 401 | + env.add("ANDROID_ROOT", "/system"); 402 | + env.add("LD_PRELOAD", "/system/lib/libc.so"); //for glibc-bionic compatibility 403 | + env.add("LD_LIBRARY_PATH", "/system/lib:/vendor/lib"); 404 | + env.add("PATH", "/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin"); 405 | + env.add("PS1", "(android)[\\u@\\h \\W]\\$ "); 406 | + 407 | + env.use_filter(true); 408 | +} 409 | + 410 | std::string const& 411 | session::get_shell_override () const 412 | { 413 | @@ -789,6 +819,12 @@ session::get_login_directories (sbuild::chroot::ptr& session_chroot, 414 | environment const& env) const 415 | { 416 | string_list ret; 417 | + 418 | + if (get_android_environment() || session_chroot->get_android_environment()) { 419 | + //Always use / for android because it is not compliant with FHS 420 | + ret.push_back("/"); 421 | + return ret; 422 | + } 423 | 424 | std::string const& wd(this->authstat->get_wd()); 425 | if (!wd.empty()) 426 | @@ -824,6 +860,12 @@ session::get_command_directories (sbuild::chroot::ptr& session_chroot, 427 | environment const& env) const 428 | { 429 | string_list ret; 430 | + 431 | + if (get_android_environment() || session_chroot->get_android_environment()) { 432 | + //Always use / for android because it is not compliant with FHS 433 | + ret.push_back("/"); 434 | + return ret; 435 | + } 436 | 437 | std::string const& wd(this->authstat->get_wd()); 438 | if (!wd.empty()) 439 | @@ -1257,6 +1299,10 @@ session::run_child (sbuild::chroot::ptr& session_chroot) 440 | env += this->authstat->get_complete_environment(); 441 | else 442 | env += this->authstat->get_auth_environment(); 443 | + 444 | + /* Environment for Android ? */ 445 | + if (get_android_environment() || session_chroot->get_android_environment()) 446 | + setup_android_env(env); 447 | 448 | // Store before chroot call. 449 | this->cwd = sbuild::getcwd(); 450 | diff --git a/sbuild/sbuild-session.h b/sbuild/sbuild-session.h 451 | index d1298db..e4c26d9 100644 452 | --- a/sbuild/sbuild-session.h 453 | +++ b/sbuild/sbuild-session.h 454 | @@ -219,6 +219,30 @@ namespace sbuild 455 | */ 456 | void 457 | set_preserve_environment (bool preserve_environment); 458 | + 459 | + /** 460 | + * Check if the Android environment should be set in the chroot. 461 | + * 462 | + * @returns true to set or false if not. 463 | + */ 464 | + bool 465 | + get_android_environment () const; 466 | + 467 | + /** 468 | + * Set if the Android environment should be set in the chroot. 469 | + * 470 | + * @param android_environment true to set or false if not. 471 | + */ 472 | + void 473 | + set_android_environment (bool android_environment); 474 | + 475 | + /** 476 | + * Setup Android environment that should be set in the chroot. 477 | + * 478 | + * @param env environment 479 | + */ 480 | + void 481 | + setup_android_env (environment &env); 482 | 483 | /** 484 | * Get user-specified login shell. 485 | @@ -580,6 +604,8 @@ namespace sbuild 486 | std::string verbosity; 487 | /// Preserve environment? 488 | bool preserve_environment; 489 | + /// Android environment? 490 | + bool android_environment; 491 | /// Login shell. 492 | std::string shell; 493 | /// User-defined options. 494 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/arch32-config: -------------------------------------------------------------------------------- 1 | # Default settings for chroot setup and exec scripts. 2 | # See schroot-script-config(5) for further details. 3 | 4 | # Filesystems to mount inside the chroot. 5 | FSTAB="/etc/schroot/arch32/mount" 6 | 7 | # Files to copy from the host system into the chroot. 8 | COPYFILES="/etc/schroot/arch32/copyfiles" 9 | 10 | # System databases to copy into the chroot 11 | NSSDATABASES="/etc/schroot/arch32/nssdatabases" 12 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/arch32-copyfiles: -------------------------------------------------------------------------------- 1 | /etc/group 2 | /etc/hosts 3 | /etc/passwd 4 | /etc/resolv.conf 5 | /etc/localtime 6 | /etc/locale.gen 7 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/arch32-example: -------------------------------------------------------------------------------- 1 | [arch32] 2 | description=Arch32 3 | type=directory 4 | directory=/opt/arch32 5 | #users=username 6 | groups=users 7 | root-groups=root 8 | profile=arch32 9 | personality=linux32 10 | #aliases=32,i686 11 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/arch32-mount: -------------------------------------------------------------------------------- 1 | # mount.defaults: static file system information for chroots. 2 | # Note that the mount point will be prefixed by the chroot path 3 | # (CHROOT_PATH) 4 | # 5 | # 6 | proc /proc proc defaults 0 0 7 | /dev /dev none rw,bind 0 0 8 | #/dev/pts /dev/pts none rw,bind 0 0 9 | tmpfs /dev/shm tmpfs defaults 0 0 10 | /sys /sys none rw,bind 0 0 11 | /tmp /tmp none rw,bind 0 0 12 | /home /home none rw,bind 0 0 13 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/arch32-nssdatabases: -------------------------------------------------------------------------------- 1 | # System databases to copy into the chroot from the host system. 2 | # 3 | # 4 | passwd 5 | shadow 6 | group 7 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/fix-bash-completion.patch: -------------------------------------------------------------------------------- 1 | --- a/etc/bash_completion/schroot 2 | +++ b/etc/bash_completion/schroot 3 | @@ -15,7 +15,7 @@ 4 | # along with this program. If not, see 5 | # . 6 | 7 | -have schroot && 8 | +_have schroot && 9 | _schroot() 10 | { 11 | local cur prev options 12 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/schroot-hybris/pam.d.schroot.patch: -------------------------------------------------------------------------------- 1 | @@ -23,13 +23,6 @@ 2 | # time restrainst on schroot usage. 3 | # account requisite pam_time.so 4 | 5 | -# The standard Unix authentication modules, used with 6 | -# NIS (man nsswitch) as well as normal /etc/passwd and 7 | -# /etc/shadow entries. 8 | -@include common-auth 9 | -@include common-account 10 | -@include common-session 11 | - 12 | # Sets up user limits, please uncomment and read /etc/security/limits.conf 13 | # to enable this functionality. 14 | # session required pam_limits.so 15 | 16 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/0001-Revert-nspawn-try-to-bind-mount-resolved-s-resolv.co.patch: -------------------------------------------------------------------------------- 1 | From 481712d9ee88395042f0640f272c1f87142bc0a8 Mon Sep 17 00:00:00 2001 2 | From: Dave Reisner 3 | Date: Wed, 9 Nov 2016 11:14:03 -0500 4 | Subject: [PATCH] Revert "nspawn: try to bind mount resolved's resolv.conf 5 | snippet into the container" 6 | 7 | This reverts commit 3539724c26a1b2b00c4eb3c004b635a4b8647de6. 8 | --- 9 | src/nspawn/nspawn.c | 27 ++++++++------------------- 10 | 1 file changed, 8 insertions(+), 19 deletions(-) 11 | 12 | diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c 13 | index c8b18bc..93df7c6 100644 14 | --- a/src/nspawn/nspawn.c 15 | +++ b/src/nspawn/nspawn.c 16 | @@ -1309,35 +1309,24 @@ static int setup_resolv_conf(const char *dest) { 17 | /* Fix resolv.conf, if possible */ 18 | where = prefix_roota(dest, "/etc/resolv.conf"); 19 | 20 | - if (access("/usr/lib/systemd/resolv.conf", F_OK) >= 0) { 21 | - /* resolved is enabled on the host. In this, case bind mount its static resolv.conf file into the 22 | - * container, so that the container can use the host's resolver. Given that network namespacing is 23 | - * disabled it's only natural of the container also uses the host's resolver. It also has the big 24 | - * advantage that the container will be able to follow the host's DNS server configuration changes 25 | - * transparently. */ 26 | - 27 | - r = mount_verbose(LOG_WARNING, "/usr/lib/systemd/resolv.conf", where, NULL, MS_BIND, NULL); 28 | - if (r >= 0) 29 | - return mount_verbose(LOG_ERR, NULL, where, NULL, 30 | - MS_BIND|MS_REMOUNT|MS_RDONLY|MS_NOSUID|MS_NODEV, NULL); 31 | - } 32 | - 33 | - /* If that didn't work, let's copy the file */ 34 | r = copy_file("/etc/resolv.conf", where, O_TRUNC|O_NOFOLLOW, 0644, 0); 35 | if (r < 0) { 36 | - /* If the file already exists as symlink, let's suppress the warning, under the assumption that 37 | - * resolved or something similar runs inside and the symlink points there. 38 | + /* If the file already exists as symlink, let's 39 | + * suppress the warning, under the assumption that 40 | + * resolved or something similar runs inside and the 41 | + * symlink points there. 42 | * 43 | - * If the disk image is read-only, there's also no point in complaining. 44 | + * If the disk image is read-only, there's also no 45 | + * point in complaining. 46 | */ 47 | log_full_errno(IN_SET(r, -ELOOP, -EROFS) ? LOG_DEBUG : LOG_WARNING, r, 48 | - "Failed to copy /etc/resolv.conf to %s, ignoring: %m", where); 49 | + "Failed to copy /etc/resolv.conf to %s: %m", where); 50 | return 0; 51 | } 52 | 53 | r = userns_lchown(where, 0, 0); 54 | if (r < 0) 55 | - log_warning_errno(r, "Failed to chown /etc/resolv.conf, ignoring: %m"); 56 | + log_warning_errno(r, "Failed to chown /etc/resolv.conf: %m"); 57 | 58 | return 0; 59 | } 60 | -- 61 | 2.10.2 62 | 63 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/0001-disable-RestrictAddressFamilies-on-i686.patch: -------------------------------------------------------------------------------- 1 | From ff59e06f9423af0532aaeedf931474823f764875 Mon Sep 17 00:00:00 2001 2 | From: Dave Reisner 3 | Date: Wed, 9 Nov 2016 08:00:26 -0500 4 | Subject: [PATCH] disable RestrictAddressFamilies on i686 5 | 6 | Shit's broke, yo. 7 | 8 | https://github.com/systemd/systemd/issues/4575 9 | --- 10 | src/core/execute.c | 4 ++++ 11 | 1 file changed, 4 insertions(+) 12 | 13 | diff --git a/src/core/execute.c b/src/core/execute.c 14 | index f666f7c..7d09154 100644 15 | --- a/src/core/execute.c 16 | +++ b/src/core/execute.c 17 | @@ -1254,6 +1254,10 @@ static int apply_address_families(const Unit* u, const ExecContext *c) { 18 | Iterator i; 19 | int r; 20 | 21 | +#if defined(__i386__) 22 | + return 0; 23 | +#endif 24 | + 25 | assert(c); 26 | 27 | if (skip_seccomp_unavailable(u, "RestrictAddressFamilies=")) 28 | -- 29 | 2.10.2 30 | 31 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/0001-nspawn-don-t-hide-bind-tmp-mounts.patch: -------------------------------------------------------------------------------- 1 | From 7ec42a45410cb27140292d85ebb0e4b6dcea5555 Mon Sep 17 00:00:00 2001 2 | From: Dave Reisner 3 | Date: Wed, 7 Dec 2016 13:45:48 -0500 4 | Subject: [PATCH] nspawn: don't hide --bind=/tmp/* mounts 5 | 6 | This is a v232-applicable version of upstream c9fd987279a462e. 7 | --- 8 | src/nspawn/nspawn-mount.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c 12 | index 115de64..2dabe2a 100644 13 | --- a/src/nspawn/nspawn-mount.c 14 | +++ b/src/nspawn/nspawn-mount.c 15 | @@ -382,7 +382,7 @@ int mount_all(const char *dest, 16 | { "tmpfs", "/dev", "tmpfs", "mode=755", MS_NOSUID|MS_STRICTATIME, true, false, false }, 17 | { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, false, false }, 18 | { "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME, true, false, false }, 19 | - { "tmpfs", "/tmp", "tmpfs", "mode=1777", MS_STRICTATIME, true, true, false }, 20 | + { "tmpfs", "/tmp", "tmpfs", "mode=1777", MS_STRICTATIME, true, false, false }, 21 | #ifdef HAVE_SELINUX 22 | { "/sys/fs/selinux", "/sys/fs/selinux", NULL, NULL, MS_BIND, false, false, false }, /* Bind mount first */ 23 | { NULL, "/sys/fs/selinux", NULL, NULL, MS_BIND|MS_RDONLY|MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_REMOUNT, false, false, false }, /* Then, make it r/o */ 24 | -- 25 | 2.10.2 26 | 27 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Michael Serpieri 2 | 3 | # Based on systemd package from archlinuxarm : 4 | 5 | # Maintainer: Dave Reisner 6 | # Maintainer: Tom Gundersen 7 | 8 | # ALARM: Kevin Mihelich 9 | # - disable gold/LTO 10 | # - removed makedepend on gnu-efi-libs, --enable-gnuefi configure option 11 | 12 | # ALARM: Michael Serpieri 13 | # - support userspace firmware loading (at least for 3.4 android kernel) 14 | 15 | pkgbase=systemd-legacy 16 | _pkgbase=systemd 17 | pkgname=('systemd-legacy' 'systemd-legacy-libsystemd' 'systemd-legacy-sysvcompat') 18 | pkgver=232 19 | pkgrel=9 20 | arch=('i686' 'x86_64' 'armv7h') 21 | url="https://www.github.com/systemd/systemd" 22 | makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf' 23 | 'intltool' 'iptables' 'kmod' 'libcap' 'libidn' 'libgcrypt' 24 | 'libmicrohttpd' 'libxslt' 'util-linux' 'linux-api-headers' 25 | 'python-lxml' 'quota-tools' 'shadow' 'git') 26 | options=('strip') 27 | source=("git://github.com/systemd/systemd.git#tag=v$pkgver" 28 | 'initcpio-hook-udev' 29 | 'initcpio-install-systemd' 30 | 'initcpio-install-udev' 31 | 'arch.conf' 32 | 'loader.conf' 33 | 'splash-arch.bmp' 34 | 'systemd-user.pam' 35 | 'systemd-hwdb.hook' 36 | 'systemd-sysusers.hook' 37 | 'systemd-tmpfiles.hook' 38 | 'systemd-update.hook' 39 | '0001-disable-RestrictAddressFamilies-on-i686.patch' 40 | '0001-Revert-nspawn-try-to-bind-mount-resolved-s-resolv.co.patch' 41 | '0001-nspawn-don-t-hide-bind-tmp-mounts.patch' 42 | 'userspace-firmware-loading-support.patch') 43 | sha512sums=('SKIP' 44 | 'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73' 45 | '52af734947a768758d5eb3f18e31a1cfec6699eca6fa10e40b90c7f11991509186c0a696e3490af3eaba80064ea4cb93e041579abf05addf072d294300aa4b28' 46 | 'fec639de0d99967ed3e67289eff5ff78fff0c5829d350e73bed536a8391f1daa1d118d72dbdc1f480ffd33fc22b72f4817d0973bd09ec7f182fd26ad87b24355' 47 | '61032d29241b74a0f28446f8cf1be0e8ec46d0847a61dadb2a4f096e8686d5f57fe5c72bcf386003f6520bc4b5856c32d63bf3efe7eb0bc0deefc9f68159e648' 48 | 'c416e2121df83067376bcaacb58c05b01990f4614ad9de657d74b6da3efa441af251d13bf21e3f0f71ddcb4c9ea658b81da3d915667dc5c309c87ec32a1cb5a5' 49 | 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e' 50 | 'b90c99d768dc2a4f020ba854edf45ccf1b86a09d2f66e475de21fe589ff7e32c33ef4aa0876d7f1864491488fd7edb2682fc0d68e83a6d4890a0778dc2d6fe19' 51 | '2c1f765e7cefc50f07ad994634ea25d9396e6b9c0de46e58f18377e642a471517a0dbf5eb547070a38c6ecf84ec8e030f650a6cee010871cd7a466a32534adda' 52 | '9d27d97f172a503f5b7044480a0b9ccc0c4ed5dbb2eb3b2b1aa929332c3bcfe38ef0c0310b6566f23b34f9c05b77035221164a7ab7677784c4a54664f12fca22' 53 | '0f4efddd25256e09c42b953caeee4b93eb49ecc6eaebf02e616b4dcbfdac9860c3d8a3d1a106325b2ebc4dbc6e08ac46702abcb67a06737227ccb052aaa2a067' 54 | '10190fba9f39a8f4b620a0829e0ba8ed63bb4dbeca712966011ee7807880d01ab2abff1a80baafeb6674db70526a473fe585db8190e864f318fc4d6068552618' 55 | '89f9b2d3918c679ce4f76c2b10dc7fcb7e04f1925a5f92542f06891de2a123a91df7eb67fd4ce71506a8132f5440b3560b7bb667e1c1813944b115c1dfe35e3f' 56 | 'b993a42c5534582631f7b379d54f6abc37e3aaa56ecf869a6d86ff14ae5a52628f4e447b6a30751bc1c14c30cec63a5c6d0aa268362d235ed477b639cac3a219' 57 | '68478403433aafc91a03fda5d83813d2ed1dfc6ab7416b2927a803314ecf826edcb6c659587e74df65de3ccb1edf958522f56ff9ac461a1f696b6dede1d4dd35' 58 | '32c36fe093d3ebc5c780b483cae3026ed6cba6b1f142158953ff1e4104a0b8eafb37b7a514b013ac579ce27ae280ddb885f7fb4cbe555892ffdb71bbfde92274') 59 | validpgpkeys=( 60 | '63CDA1E5D3FC22B998D20DD6327F26951A015CC4' # Lennart Poettering 61 | ) 62 | 63 | _backports=( 64 | '843d5baf6aad6c53fc00ea8d95d83209a4f92de1' # core: don't use the unified hierarchy for the systemd cgroup yet (#4628) 65 | 'abd67ce74858491565cde157c7b08fda43d3279c' # basic/virt: fix userns check on CONFIG_USER_NS=n kernel (#4651) 66 | '4318abe8d26e969ebdb97744a63ab900233a0185' # build-sys: do not install ctrl-alt-del.target symlink twice 67 | 'd112eae7da77899be245ab52aa1747d4675549f1' # device: Avoid calling unit_free(NULL) in device setup logic (#4748) 68 | 'cfed63f60dd7412c199652825ed172c319b02b3c' # nspawn: fix exit code for --help and --version (#4609) 69 | '3099caf2b5bb9498b1d0227c40926435ca81f26f' # journal: make sure to initially populate the space info cache (#4807) 70 | '3d4cf7de48a74726694abbaa09f9804b845ff3ba' # build-sys: check for lz4 in the old and new numbering scheme (#4717) 71 | ) 72 | 73 | _validate_tag() { 74 | local success fingerprint trusted status tag=v$pkgver 75 | 76 | parse_gpg_statusfile /dev/stdin < <(git verify-tag --raw "$tag" 2>&1) 77 | 78 | if (( ! success )); then 79 | error 'failed to validate tag %s\n' "$tag" 80 | return 1 81 | fi 82 | 83 | if ! in_array "$fingerprint" "${validpgpkeys[@]}" && (( ! trusted )); then 84 | error 'unknown or untrusted public key: %s\n' "$fingerprint" 85 | return 1 86 | fi 87 | 88 | case $status in 89 | 'expired') 90 | warning 'the signature has expired' 91 | ;; 92 | 'expiredkey') 93 | warning 'the key has expired' 94 | ;; 95 | esac 96 | 97 | return 0 98 | } 99 | 100 | prepare() { 101 | cd "$srcdir/$_pkgbase" 102 | 103 | #_validate_tag || return 104 | 105 | if (( ${#_backports[*]} > 0 )); then 106 | git cherry-pick -n "${_backports[@]}" 107 | fi 108 | 109 | # https://github.com/systemd/systemd/issues/4789 110 | patch -Np1 <../0001-nspawn-don-t-hide-bind-tmp-mounts.patch 111 | 112 | # these patches aren't upstream, but they make v232 more useable. 113 | 114 | # https://github.com/systemd/systemd/issues/4575 115 | patch -Np1 <../0001-disable-RestrictAddressFamilies-on-i686.patch 116 | 117 | # https://github.com/systemd/systemd/issues/4595 118 | # https://github.com/systemd/systemd/issues/3826 119 | patch -Np1 <../0001-Revert-nspawn-try-to-bind-mount-resolved-s-resolv.co.patch 120 | 121 | # legacy: userspace firmware loading support 122 | git apply "$srcdir/userspace-firmware-loading-support.patch" 123 | 124 | ./autogen.sh 125 | } 126 | 127 | build() { 128 | cd "$srcdir/$_pkgbase" 129 | 130 | local timeservers=({0..3}.arch.pool.ntp.org) 131 | 132 | LDFLAGS+=" -Wl,-fuse-ld=bfd" 133 | CFLAGS+=" -fno-lto" 134 | CXXFLAGS+=" -fno-lto" 135 | 136 | local configure_options=( 137 | --libexecdir=/usr/lib 138 | --localstatedir=/var 139 | --sysconfdir=/etc 140 | 141 | --enable-lz4 142 | --disable-audit 143 | --disable-ima 144 | 145 | --with-sysvinit-path= 146 | --with-sysvrcnd-path= 147 | --with-ntp-servers="${timeservers[*]}" 148 | --with-default-dnssec=no 149 | --with-dbuspolicydir=/usr/share/dbus-1/system.d 150 | --without-kill-user-processes 151 | --with-firmware-path=/usr/lib/firmware 152 | ) 153 | 154 | ./configure "${configure_options[@]}" 155 | 156 | make 157 | } 158 | 159 | package_systemd-legacy() { 160 | pkgdesc="system and service manager" 161 | license=('GPL2' 'LGPL2.1') 162 | depends=('acl' 'bash' 'dbus' 'iptables' 'kbd' 'kmod' 'hwids' 'libcap' 163 | 'libgcrypt' 'systemd-legacy-libsystemd' 'libidn' 'lz4' 'pam' 'libelf' 'libseccomp' 164 | 'util-linux' 'xz') 165 | provides=('systemd' 'nss-myhostname' "systemd-tools=$pkgver" "udev=$pkgver") 166 | replaces=('systemd' 'nss-myhostname' 'systemd-tools' 'udev') 167 | conflicts=('systemd' 'nss-myhostname' 'systemd-tools' 'udev') 168 | optdepends=('cryptsetup: required for encrypted block devices' 169 | 'libmicrohttpd: remote journald capabilities' 170 | 'quota-tools: kernel-level quota management' 171 | 'systemd-sysvcompat: symlink package to provide sysvinit binaries' 172 | 'polkit: allow administration as unprivileged user') 173 | backup=(etc/pam.d/systemd-user 174 | etc/systemd/coredump.conf 175 | etc/systemd/journald.conf 176 | etc/systemd/journal-remote.conf 177 | etc/systemd/journal-upload.conf 178 | etc/systemd/logind.conf 179 | etc/systemd/system.conf 180 | etc/systemd/timesyncd.conf 181 | etc/systemd/resolved.conf 182 | etc/systemd/user.conf 183 | etc/udev/udev.conf) 184 | install="systemd.install" 185 | 186 | make -C "$srcdir/$_pkgbase" DESTDIR="$pkgdir" install 187 | 188 | # don't write units to /etc by default. some of these will be re-enabled on 189 | # post_install. 190 | rm -r "$pkgdir/etc/systemd/system/"*.wants 191 | 192 | # get rid of RPM macros 193 | rm -r "$pkgdir/usr/lib/rpm" 194 | 195 | # add back tmpfiles.d/legacy.conf 196 | install -m644 "$srcdir/$_pkgbase/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d" 197 | 198 | # Replace dialout/tape/cdrom group in rules with uucp/storage/optical group 199 | sed -i 's#GROUP="dialout"#GROUP="uucp"#g; 200 | s#GROUP="tape"#GROUP="storage"#g; 201 | s#GROUP="cdrom"#GROUP="optical"#g' "$pkgdir"/usr/lib/udev/rules.d/*.rules 202 | sed -i 's/dialout/uucp/g; 203 | s/tape/storage/g; 204 | s/cdrom/optical/g' "$pkgdir"/usr/lib/sysusers.d/basic.conf 205 | 206 | # add mkinitcpio hooks 207 | install -Dm644 "$srcdir/initcpio-install-systemd" "$pkgdir/usr/lib/initcpio/install/systemd" 208 | install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev" 209 | install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev" 210 | 211 | # ensure proper permissions for /var/log/journal. This is only to placate 212 | chown root:systemd-journal "$pkgdir/var/log/journal" 213 | chmod 2755 "$pkgdir/var/log/journal" 214 | 215 | # we'll create this on installation 216 | rmdir "$pkgdir/var/log/journal/remote" 217 | 218 | # ship default policy to leave services disabled 219 | echo 'disable *' >"$pkgdir"/usr/lib/systemd/system-preset/99-default.preset 220 | 221 | ### manpages shipped with systemd-sysvcompat 222 | rm "$pkgdir"/usr/share/man/man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 223 | 224 | ### runtime libraries shipped with libsystemd 225 | rm "$pkgdir"/usr/lib/lib{nss,systemd,udev}*.so* 226 | 227 | # add example bootctl configuration 228 | install -Dm644 "$srcdir/arch.conf" "$pkgdir"/usr/share/systemd/bootctl/arch.conf 229 | install -Dm644 "$srcdir/loader.conf" "$pkgdir"/usr/share/systemd/bootctl/loader.conf 230 | install -Dm644 "$srcdir/splash-arch.bmp" "$pkgdir"/usr/share/systemd/bootctl/splash-arch.bmp 231 | 232 | install -Dm644 "$srcdir/systemd-hwdb.hook" "$pkgdir/usr/share/libalpm/hooks/systemd-hwdb.hook" 233 | install -Dm644 "$srcdir/systemd-sysusers.hook" "$pkgdir/usr/share/libalpm/hooks/systemd-sysusers.hook" 234 | install -Dm644 "$srcdir/systemd-tmpfiles.hook" "$pkgdir/usr/share/libalpm/hooks/systemd-tmpfiles.hook" 235 | install -Dm644 "$srcdir/systemd-update.hook" "$pkgdir/usr/share/libalpm/hooks/systemd-update.hook" 236 | 237 | # overwrite the systemd-user PAM configuration with our own 238 | install -Dm644 "$srcdir/systemd-user.pam" "$pkgdir/etc/pam.d/systemd-user" 239 | } 240 | 241 | package_systemd-legacy-libsystemd() { 242 | pkgdesc="systemd client libraries" 243 | depends=('glibc' 'libcap' 'libgcrypt' 'lz4' 'xz') 244 | license=('GPL2') 245 | provides=('libsystemd' 'libsystemd.so' 'libudev.so') 246 | replaces=('libsystemd') 247 | conflicts=('libsystemd') 248 | 249 | make -C "$srcdir/$_pkgbase" DESTDIR="$pkgdir" install-rootlibLTLIBRARIES 250 | } 251 | 252 | package_systemd-legacy-sysvcompat() { 253 | pkgdesc="sysvinit compat for systemd" 254 | license=('GPL2') 255 | groups=('base') 256 | conflicts=('systemd-sysvcompat' 'sysvinit') 257 | replaces=('systemd-sysvcompat') 258 | depends=('systemd-legacy') 259 | 260 | install -dm755 "$pkgdir"/usr/share/man/man8 261 | cp -d --no-preserve=ownership,timestamp \ 262 | "$srcdir/$_pkgbase"/man/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 \ 263 | "$pkgdir"/usr/share/man/man8 264 | 265 | install -dm755 "$pkgdir/usr/bin" 266 | for tool in runlevel reboot shutdown poweroff halt telinit; do 267 | ln -s 'systemctl' "$pkgdir/usr/bin/$tool" 268 | done 269 | 270 | ln -s '../lib/systemd/systemd' "$pkgdir/usr/bin/init" 271 | } 272 | 273 | # vim: ft=sh syn=sh et 274 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/arch.conf: -------------------------------------------------------------------------------- 1 | ## This is just an example config file. 2 | ## Please edit the paths and kernel parameters according to your system. 3 | 4 | title Arch Linux 5 | linux /vmlinuz-linux 6 | initrd /initramfs-linux.img 7 | options root=PARTUUID=XXXX rootfstype=XXXX add_efi_memmap 8 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/initcpio-hook-udev: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ash 2 | 3 | run_earlyhook() { 4 | kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf 5 | systemd-tmpfiles --prefix=/dev --create --boot 6 | /usr/lib/systemd/systemd-udevd --daemon --resolve-names=never 7 | udevd_running=1 8 | } 9 | 10 | run_hook() { 11 | msg ":: Triggering uevents..." 12 | udevadm trigger --action=add --type=subsystems 13 | udevadm trigger --action=add --type=devices 14 | udevadm settle 15 | } 16 | 17 | run_cleanuphook() { 18 | udevadm control --exit 19 | udevadm info --cleanup-db 20 | } 21 | 22 | # vim: set ft=sh ts=4 sw=4 et: 23 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/initcpio-install-systemd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | strip_quotes() { 4 | local len=${#1} quotes=$'[\'"]' str=${!1} 5 | 6 | if [[ ${str:0:1} = ${str: -1} && ${str:0:1} = $quotes ]]; then 7 | printf -v "$1" %s "${str:1:-1}" 8 | fi 9 | } 10 | 11 | add_udev_rule() { 12 | # Add an udev rules file to the initcpio image. Dependencies on binaries 13 | # will be discovered and added. 14 | # $1: path to rules file (or name of rules file) 15 | 16 | local rules= rule= key= value= binary= 17 | 18 | rules=$(PATH=/usr/lib/udev/rules.d:/lib/udev/rules.d type -P "$1") 19 | if [[ -z $rules ]]; then 20 | # complain about not found rules 21 | return 1 22 | fi 23 | 24 | add_file "$rules" 25 | 26 | while IFS=, read -ra rule; do 27 | # skip empty lines, comments 28 | [[ -z $rule || $rule = @(+([[:space:]])|#*) ]] && continue 29 | 30 | for pair in "${rule[@]}"; do 31 | IFS=' =' read -r key value <<< "$pair" 32 | case $key in 33 | RUN@({program}|+)|IMPORT{program}|ENV{REMOVE_CMD}) 34 | strip_quotes 'value' 35 | # just take the first word as the binary name 36 | binary=${value%% *} 37 | [[ ${binary:0:1} == '$' ]] && continue 38 | if [[ ${binary:0:1} != '/' ]]; then 39 | binary=$(PATH=/usr/lib/udev:/lib/udev type -P "$binary") 40 | fi 41 | add_binary "$binary" 42 | ;; 43 | esac 44 | done 45 | done <"$rules" 46 | } 47 | 48 | add_systemd_unit() { 49 | # Add a systemd unit file to the initcpio image. Hard dependencies on binaries 50 | # and other unit files will be discovered and added. 51 | # $1: path to rules file (or name of rules file) 52 | 53 | local unit= rule= entry= key= value= binary= dep= 54 | 55 | unit=$(PATH=/usr/lib/systemd/system:/lib/systemd/system type -P "$1") 56 | if [[ -z $unit ]]; then 57 | # complain about not found unit file 58 | return 1 59 | fi 60 | 61 | add_file "$unit" 62 | 63 | while IFS='=' read -r key values; do 64 | read -ra values <<< "$values" 65 | 66 | case $key in 67 | Requires|OnFailure) 68 | # only add hard dependencies (not Wants) 69 | map add_systemd_unit "${values[@]}" 70 | ;; 71 | Exec*) 72 | # don't add binaries unless they are required 73 | if [[ ${values[0]:0:1} != '-' ]]; then 74 | add_binary "${values[0]}" 75 | fi 76 | ;; 77 | esac 78 | 79 | done <"$unit" 80 | 81 | # preserve reverse soft dependency 82 | for dep in {/usr,}/lib/systemd/system/*.wants/${unit##*/}; do 83 | if [[ -L $dep ]]; then 84 | add_symlink "$dep" 85 | fi 86 | done 87 | 88 | # add hard dependencies 89 | if [[ -d $unit.requires ]]; then 90 | for dep in "$unit".requires/*; do 91 | add_systemd_unit ${dep##*/} 92 | done 93 | fi 94 | } 95 | 96 | add_systemd_drop_in() { 97 | local unit=$1 dropin_name=$2 98 | 99 | mkdir -p "$BUILDROOT/etc/systemd/system/$unit.d" 100 | cat >"$BUILDROOT/etc/systemd/system/$unit.d/$2.conf" 101 | } 102 | 103 | build() { 104 | local rules unit 105 | 106 | # from base 107 | add_binary /bin/mount 108 | add_binary /usr/bin/kmod /usr/bin/modprobe 109 | add_binary /usr/lib/systemd/systemd /init 110 | add_binary /usr/bin/sulogin 111 | 112 | map add_binary \ 113 | /usr/bin/systemd-tmpfiles \ 114 | /usr/lib/systemd/systemd-hibernate-resume \ 115 | /usr/lib/systemd/system-generators/systemd-fstab-generator \ 116 | /usr/lib/systemd/system-generators/systemd-gpt-auto-generator \ 117 | /usr/lib/systemd/system-generators/systemd-hibernate-resume-generator 118 | 119 | # udev rules and systemd units 120 | map add_udev_rule "$rules" \ 121 | 50-udev-default.rules \ 122 | 60-persistent-storage.rules \ 123 | 64-btrfs.rules \ 124 | 80-drivers.rules \ 125 | 99-systemd.rules 126 | 127 | map add_systemd_unit \ 128 | initrd-cleanup.service \ 129 | initrd-fs.target \ 130 | initrd-parse-etc.service \ 131 | initrd-root-fs.target \ 132 | initrd-root-device.target \ 133 | initrd-switch-root.service \ 134 | initrd-switch-root.target \ 135 | initrd-udevadm-cleanup-db.service \ 136 | initrd.target \ 137 | kmod-static-nodes.service \ 138 | local-fs.target \ 139 | local-fs-pre.target \ 140 | paths.target \ 141 | reboot.target \ 142 | slices.target \ 143 | sockets.target \ 144 | swap.target \ 145 | systemd-fsck@.service \ 146 | systemd-hibernate-resume@.service \ 147 | systemd-journald.service \ 148 | systemd-journald-audit.socket \ 149 | systemd-journald-dev-log.socket \ 150 | systemd-modules-load.service \ 151 | systemd-tmpfiles-setup-dev.service \ 152 | systemd-udev-trigger.service \ 153 | systemd-udevd-control.socket \ 154 | systemd-udevd-kernel.socket \ 155 | systemd-udevd.service \ 156 | timers.target \ 157 | rescue.target \ 158 | emergency.target 159 | 160 | add_symlink "/usr/lib/systemd/system/default.target" "initrd.target" 161 | add_symlink "/usr/lib/systemd/system/ctrl-alt-del.target" "reboot.target" 162 | 163 | # udev wants /etc/group since it doesn't launch with --resolve-names=never 164 | add_file "/etc/nsswitch.conf" 165 | add_binary "$(readlink -f /usr/lib/libnss_files.so)" 166 | 167 | echo "root:x:0:0:root:/:/bin/sh" >"$BUILDROOT/etc/passwd" 168 | echo "root:x:0:root" >"$BUILDROOT/etc/group" 169 | echo "root::::::::" >"$BUILDROOT/etc/shadow" 170 | 171 | add_systemd_drop_in systemd-udevd.service resolve-names <"$BUILDROOT/etc/modules-load.d/MODULES.conf" 182 | ) 183 | } 184 | 185 | help() { 186 | cat </dev/null 10 | : 11 | } 12 | 13 | post_common() { 14 | systemd-sysusers 15 | journalctl --update-catalog 16 | } 17 | 18 | _216_2_changes() { 19 | echo ':: Coredumps are handled by systemd by default. Collection behavior can be' 20 | echo ' tuned in /etc/systemd/coredump.conf.' 21 | } 22 | 23 | _219_2_changes() { 24 | if mkdir -m2755 var/log/journal/remote 2>/dev/null; then 25 | chgrp systemd-journal-remote var/log/journal/remote 26 | fi 27 | } 28 | 29 | _219_4_changes() { 30 | if ! systemctl is-enabled -q remote-fs.target; then 31 | systemctl enable -q remote-fs.target 32 | fi 33 | } 34 | 35 | _230_1_changes() { 36 | echo ':: systemd-bootchart is no longer included with systemd' 37 | } 38 | 39 | _232_8_changes() { 40 | # paper over possible effects of CVE-2016-10156 41 | local stamps=(/var/lib/systemd/timers/*.timer) 42 | 43 | if [[ -f ${stamps[0]} ]]; then 44 | chmod 0644 "${stamps[@]}" 45 | fi 46 | } 47 | 48 | post_install() { 49 | systemd-machine-id-setup 50 | 51 | post_common "$@" 52 | 53 | add_journal_acls 54 | 55 | # enable some services by default, but don't track them 56 | systemctl enable getty@tty1.service remote-fs.target 57 | 58 | echo ":: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your" 59 | echo " bootloader to replace sysvinit with systemd, or install systemd-sysvcompat" 60 | 61 | # group 'systemd-journal-remote' is created by systemd-sysusers 62 | mkdir -m2755 var/log/journal/remote 63 | chgrp systemd-journal-remote var/log/journal/remote 64 | } 65 | 66 | post_upgrade() { 67 | post_common "$@" 68 | 69 | # don't reexec if the old version is 231-1 or 231-2. 70 | # https://github.com/systemd/systemd/commit/bd64d82c1c 71 | if [[ $1 != 231-[12] ]] && sd_booted; then 72 | systemctl --system daemon-reexec 73 | fi 74 | 75 | local v upgrades=( 76 | 216-2 77 | 219-2 78 | 219-4 79 | 230-1 80 | 232-8 81 | ) 82 | 83 | for v in "${upgrades[@]}"; do 84 | if [[ $(vercmp "$v" "$2") -eq 1 ]]; then 85 | "_${v//-/_}_changes" 86 | fi 87 | done 88 | } 89 | 90 | # vim:set ts=2 sw=2 et: 91 | -------------------------------------------------------------------------------- /GNULinux/Archlinux/PKGBUILDs/systemd-legacy/userspace-firmware-loading-support.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Makefile.am b/Makefile.am 2 | index f7652c234..22c30752e 100644 3 | --- a/Makefile.am 4 | +++ b/Makefile.am 5 | @@ -3787,6 +3787,18 @@ libudev_core_la_LIBADD = \ 6 | $(BLKID_LIBS) \ 7 | $(KMOD_LIBS) 8 | 9 | +libudev_core_la_CPPFLAGS = \ 10 | + $(AM_CPPFLAGS) \ 11 | + -DFIRMWARE_PATH="$(FIRMWARE_PATH)" 12 | + 13 | +if ENABLE_FIRMWARE 14 | +libudev_core_la_SOURCES += \ 15 | + src/udev/udev-builtin-firmware.c 16 | + 17 | +dist_udevrules_DATA += \ 18 | + rules/50-firmware.rules 19 | +endif 20 | + 21 | if HAVE_KMOD 22 | libudev_core_la_SOURCES += \ 23 | src/udev/udev-builtin-kmod.c 24 | diff --git a/README b/README 25 | index 9f5bc9382..79e0e8b87 100644 26 | --- a/README 27 | +++ b/README 28 | @@ -50,14 +50,14 @@ REQUIREMENTS: 29 | CONFIG_PROC_FS 30 | CONFIG_FHANDLE (libudev, mount and bind mount handling) 31 | 32 | - udev will fail to work with the legacy sysfs layout: 33 | + Udev will fail to work with the legacy layout: 34 | CONFIG_SYSFS_DEPRECATED=n 35 | 36 | Legacy hotplug slows down the system and confuses udev: 37 | CONFIG_UEVENT_HELPER_PATH="" 38 | 39 | - Userspace firmware loading is not supported and should 40 | - be disabled in the kernel: 41 | + Userspace firmware loading is deprecated, will go away, and 42 | + sometimes causes problems: 43 | CONFIG_FW_LOADER_USER_HELPER=n 44 | 45 | Some udev rules and virtualization detection relies on it: 46 | diff --git a/TODO b/TODO 47 | index c8266a549..6e6952955 100644 48 | --- a/TODO 49 | +++ b/TODO 50 | @@ -667,6 +667,7 @@ Features: 51 | * initialize the hostname from the fs label of /, if /etc/hostname does not exist? 52 | 53 | * udev: 54 | + - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n) 55 | - move to LGPL 56 | - kill scsi_id 57 | - add trigger --subsystem-match=usb/usb_device device 58 | diff --git a/configure.ac b/configure.ac 59 | index 0b10fc7de..8a75e3a0d 100644 60 | --- a/configure.ac 61 | +++ b/configure.ac 62 | @@ -1383,6 +1383,25 @@ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database 63 | AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes]) 64 | 65 | # ------------------------------------------------------------------------------ 66 | +AC_ARG_WITH(firmware-path, 67 | + AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], 68 | + [Firmware search path (default="")]), 69 | + [], [with_firmware_path=""]) 70 | +OLD_IFS=$IFS 71 | +IFS=: 72 | +for i in $with_firmware_path; do 73 | + if test "x${FIRMWARE_PATH}" = "x"; then 74 | + FIRMWARE_PATH="\\\"${i}/\\\"" 75 | + else 76 | + FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" 77 | + fi 78 | +done 79 | +IFS=$OLD_IFS 80 | +AC_SUBST(FIRMWARE_PATH) 81 | +AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ]) 82 | +AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"]) 83 | + 84 | +# ------------------------------------------------------------------------------ 85 | have_manpages=no 86 | AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages])) 87 | AC_PATH_PROG([XSLTPROC], [xsltproc]) 88 | @@ -1667,6 +1686,7 @@ AC_MSG_RESULT([ 89 | hibernate support: ${enable_hibernate} 90 | extra debugging: ${enable_debug} 91 | tests: ${enable_tests} 92 | + firmware path: ${FIRMWARE_PATH} 93 | 94 | prefix: ${prefix} 95 | rootprefix: ${with_rootprefix} 96 | diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules 97 | new file mode 100644 98 | index 000000000..f0ae68451 99 | --- /dev/null 100 | +++ b/rules/50-firmware.rules 101 | @@ -0,0 +1,3 @@ 102 | +# do not edit this file, it will be overwritten on update 103 | + 104 | +SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware" 105 | diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c 106 | new file mode 100644 107 | index 000000000..bd8c2fb96 108 | --- /dev/null 109 | +++ b/src/udev/udev-builtin-firmware.c 110 | @@ -0,0 +1,154 @@ 111 | +/* 112 | + * firmware - Kernel firmware loader 113 | + * 114 | + * Copyright (C) 2009 Piter Punk 115 | + * Copyright (C) 2009-2011 Kay Sievers 116 | + * 117 | + * This program is free software; you can redistribute it and/or 118 | + * modify it under the terms of the GNU General Public License as 119 | + * published by the Free Software Foundation; either version 2 of the 120 | + * License, or (at your option) any later version. 121 | + * 122 | + * This program is distributed in the hope that it will be useful, but 123 | + * WITHOUT ANY WARRANTY; without even the implied warranty of 124 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 125 | + * General Public License for more details:* 126 | + */ 127 | + 128 | +#include 129 | +#include 130 | +#include 131 | +#include 132 | +#include 133 | +#include 134 | +#include 135 | +#include 136 | +#include 137 | + 138 | +#include "udev.h" 139 | + 140 | +static bool set_loading(struct udev *udev, char *loadpath, const char *state) { 141 | + FILE *ldfile; 142 | + 143 | + ldfile = fopen(loadpath, "we"); 144 | + if (ldfile == NULL) { 145 | + log_error("error: can not open '%s'", loadpath); 146 | + return false; 147 | + }; 148 | + fprintf(ldfile, "%s\n", state); 149 | + fclose(ldfile); 150 | + return true; 151 | +} 152 | + 153 | +static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) { 154 | + char *buf; 155 | + FILE *fsource = NULL, *ftarget = NULL; 156 | + bool ret = false; 157 | + 158 | + buf = malloc(size); 159 | + if (buf == NULL) { 160 | + log_error("No memory available to load firmware file"); 161 | + return false; 162 | + } 163 | + 164 | + log_debug("writing '%s' (%zi) to '%s'", source, size, target); 165 | + 166 | + fsource = fopen(source, "re"); 167 | + if (fsource == NULL) 168 | + goto exit; 169 | + ftarget = fopen(target, "we"); 170 | + if (ftarget == NULL) 171 | + goto exit; 172 | + if (fread(buf, size, 1, fsource) != 1) 173 | + goto exit; 174 | + if (fwrite(buf, size, 1, ftarget) == 1) 175 | + ret = true; 176 | +exit: 177 | + if (ftarget != NULL) 178 | + fclose(ftarget); 179 | + if (fsource != NULL) 180 | + fclose(fsource); 181 | + free(buf); 182 | + return ret; 183 | +} 184 | + 185 | +static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) { 186 | + struct udev *udev = udev_device_get_udev(dev); 187 | + static const char *searchpath[] = { FIRMWARE_PATH }; 188 | + char loadpath[UTIL_PATH_SIZE]; 189 | + char datapath[UTIL_PATH_SIZE]; 190 | + char fwpath[UTIL_PATH_SIZE]; 191 | + const char *firmware; 192 | + FILE *fwfile = NULL; 193 | + struct utsname kernel; 194 | + struct stat statbuf; 195 | + unsigned int i; 196 | + int rc = EXIT_SUCCESS; 197 | + 198 | + firmware = udev_device_get_property_value(dev, "FIRMWARE"); 199 | + if (firmware == NULL) { 200 | + log_error("firmware parameter missing"); 201 | + rc = EXIT_FAILURE; 202 | + goto exit; 203 | + } 204 | + 205 | + /* lookup firmware file */ 206 | + uname(&kernel); 207 | + for (i = 0; i < ELEMENTSOF(searchpath); i++) { 208 | + strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL); 209 | + fwfile = fopen(fwpath, "re"); 210 | + if (fwfile != NULL) 211 | + break; 212 | + 213 | + strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL); 214 | + fwfile = fopen(fwpath, "re"); 215 | + if (fwfile != NULL) 216 | + break; 217 | + } 218 | + 219 | + strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL); 220 | + 221 | + if (fwfile == NULL) { 222 | + log_debug("did not find firmware file '%s'", firmware); 223 | + rc = EXIT_FAILURE; 224 | + /* 225 | + * Do not cancel the request in the initrd, the real root might have 226 | + * the firmware file and the 'coldplug' run in the real root will find 227 | + * this pending request and fulfill or cancel it. 228 | + * */ 229 | + if (!in_initrd()) 230 | + set_loading(udev, loadpath, "-1"); 231 | + goto exit; 232 | + } 233 | + 234 | + if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) { 235 | + if (!in_initrd()) 236 | + set_loading(udev, loadpath, "-1"); 237 | + rc = EXIT_FAILURE; 238 | + goto exit; 239 | + } 240 | + 241 | + if (!set_loading(udev, loadpath, "1")) 242 | + goto exit; 243 | + 244 | + strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL); 245 | + if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) { 246 | + log_error("error sending firmware '%s' to device", firmware); 247 | + set_loading(udev, loadpath, "-1"); 248 | + rc = EXIT_FAILURE; 249 | + goto exit; 250 | + }; 251 | + 252 | + set_loading(udev, loadpath, "0"); 253 | +exit: 254 | + if (fwfile) 255 | + fclose(fwfile); 256 | + return rc; 257 | +} 258 | + 259 | +const struct udev_builtin udev_builtin_firmware = { 260 | + .name = "firmware", 261 | + .cmd = builtin_firmware, 262 | + .help = "kernel firmware loader", 263 | + .run_once = true, 264 | +}; 265 | diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c 266 | index e6b36f124..cd9947e2a 100644 267 | --- a/src/udev/udev-builtin.c 268 | +++ b/src/udev/udev-builtin.c 269 | @@ -31,6 +31,9 @@ static const struct udev_builtin *builtins[] = { 270 | [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid, 271 | #endif 272 | [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs, 273 | +#ifdef HAVE_FIRMWARE 274 | + [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware, 275 | +#endif 276 | [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb, 277 | [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id, 278 | [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard, 279 | diff --git a/src/udev/udev.h b/src/udev/udev.h 280 | index 8433e8d9f..d32366d94 100644 281 | --- a/src/udev/udev.h 282 | +++ b/src/udev/udev.h 283 | @@ -148,6 +148,9 @@ enum udev_builtin_cmd { 284 | UDEV_BUILTIN_BLKID, 285 | #endif 286 | UDEV_BUILTIN_BTRFS, 287 | +#ifdef HAVE_FIRMWARE 288 | + UDEV_BUILTIN_FIRMWARE, 289 | +#endif 290 | UDEV_BUILTIN_HWDB, 291 | UDEV_BUILTIN_INPUT_ID, 292 | UDEV_BUILTIN_KEYBOARD, 293 | @@ -176,6 +179,9 @@ struct udev_builtin { 294 | extern const struct udev_builtin udev_builtin_blkid; 295 | #endif 296 | extern const struct udev_builtin udev_builtin_btrfs; 297 | +#ifdef HAVE_FIRMWARE 298 | +extern const struct udev_builtin udev_builtin_firmware; 299 | +#endif 300 | extern const struct udev_builtin udev_builtin_hwdb; 301 | extern const struct udev_builtin udev_builtin_input_id; 302 | extern const struct udev_builtin udev_builtin_keyboard; 303 | diff --git a/src/udev/udevd.c b/src/udev/udevd.c 304 | index badbab620..66bd3634c 100644 305 | --- a/src/udev/udevd.c 306 | +++ b/src/udev/udevd.c 307 | @@ -125,6 +125,9 @@ struct event { 308 | bool is_block; 309 | sd_event_source *timeout_warning; 310 | sd_event_source *timeout; 311 | +#ifdef HAVE_FIRMWARE 312 | + bool nodelay; 313 | +#endif 314 | }; 315 | 316 | static inline struct event *node_to_event(struct udev_list_node *node) { 317 | @@ -613,6 +616,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) { 318 | event->devnum = udev_device_get_devnum(dev); 319 | event->is_block = streq("block", udev_device_get_subsystem(dev)); 320 | event->ifindex = udev_device_get_ifindex(dev); 321 | +#ifdef HAVE_FIRMWARE 322 | + if (streq(udev_device_get_subsystem(dev), "firmware")) 323 | + event->nodelay = true; 324 | +#endif 325 | 326 | log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev), 327 | udev_device_get_action(dev), udev_device_get_subsystem(dev)); 328 | @@ -698,6 +705,12 @@ static bool is_devpath_busy(Manager *manager, struct event *event) { 329 | return true; 330 | } 331 | 332 | +#ifdef HAVE_FIRMWARE 333 | + /* allow to bypass the dependency tracking */ 334 | + if (event->nodelay) 335 | + continue; 336 | +#endif 337 | + 338 | /* parent device event found */ 339 | if (event->devpath[common] == '/') { 340 | event->delaying_seqnum = loop_event->seqnum; 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GNU/Linux for Android devices 2 | ## GNU/Linux | Android | Convergence 3 | 4 | The target of this project is to create a convergence between the desktop and the mobile/phablet... so to build new mobile OS based on existing GNU/Linux distributions with the most common parts possible. 5 | 6 | This repository include : 7 | - Android build integration 8 | - Android OTA zip file creation per distribution 9 | - Distributions packaging (not yet available upstream) to build a GNU/Linux system with Android Hardware/software support 10 | - Documentation about architecture, device portage, build instruction, ... 11 | 12 | ## Halium 13 | 14 | Work in progress to fit with Halium initiative. We try our best to don't break anything as gnulinx_support and Halium will have some divergence. 15 | 16 | ## Documentation 17 | Please read the complete documentation available under [Docs](https://github.com/mickybart/gnulinux_support/tree/master/Docs/main.md). 18 | That will permit you to support this project by porting new Android devices or new distributions compatible. 19 | 20 | GNU/Linux distribution needs support for : 21 | - ARM architecture 22 | - systemd 23 | - Qt 5.6 24 | - plasma 5.6 25 | 26 | ## Distributions supported 27 | - Archlinux (archlinuxarm) 28 | - *help us to port Fedora, Redhat, Debian, Gentoo ...* 29 | 30 | ## Android devices supported 31 | - Sony Xperia S (Nozomi) : in progress (our reference device) 32 | - *more to come with your help* 33 | 34 | --------------------------------------------------------------------------------