diff --git a/make_empty_image.sh b/make_empty_image.sh index acb315c2..bd59d17b 100755 --- a/make_empty_image.sh +++ b/make_empty_image.sh @@ -14,6 +14,11 @@ if [ -z "$IMAGE_NAME" ]; then exit 1 fi +if [ "$(id -u)" -ne "0" ]; then + echo "This script requires root (not really - but make_image.sh will fail later without root)" + exit 1 +fi + fallocate -l $IMAGE_SIZE $IMAGE_NAME cat << EOF | fdisk $IMAGE_NAME diff --git a/make_rootfs.sh b/make_rootfs.sh index 779c7416..5f6d60fd 100755 --- a/make_rootfs.sh +++ b/make_rootfs.sh @@ -100,16 +100,19 @@ killall -KILL gpg-agent pacman -Sy --noconfirm pacman -Rsn --noconfirm linux-aarch64 pacman -S --noconfirm --needed dosfstools curl xz iw rfkill netctl dialog wpa_supplicant alsa-utils \ - pv linux-pine64 linux-pine64-headers networkmanager dkms-rtl8723cs uboot-pine64-git + pv linux-pine64 linux-pine64-headers networkmanager dkms-rtl8723cs uboot-pine64-git \ + rtl8723bt-firmware # Install XFCE pacman -S --noconfirm xfce4 xorg-server xf86-input-libinput lxdm ttf-dejavu ttf-liberation firefox \ pulseaudio nm-connection-editor network-manager-applet \ xfce4-pulseaudio-plugin \ + blueman pulseaudio-bluetooth \ pulseaudio-alsa pavucontrol systemctl enable lxdm systemctl enable NetworkManager -usermod -a -G network,video,audio,optical,storage,input,scanner,games,lp alarm +systemctl enable bluetooth +usermod -a -G network,video,audio,optical,storage,input,scanner,games,lp,rfkill alarm sed -i 's|^#en_US.UTF-8|en_US.UTF-8|' /etc/locale.gen cd /usr/share/i18n/charmaps @@ -130,11 +133,10 @@ rm "$DEST/usr/bin/qemu-arm-static" mv "$DEST/etc/resolv.conf.dist" "$DEST/etc/resolv.conf" cp $OTHERDIR/asound.state $DEST/var/lib/alsa -cp $OTHERDIR/pine64_first_boot.sh $DEST/usr/local/sbin/ cp $OTHERDIR/resize_rootfs.sh $DEST/usr/local/sbin/ -cp $OTHERDIR/pine64-first-boot.service $DEST/etc/systemd/system/ cp $OTHERDIR/modesetting.conf $DEST/etc/X11/xorg.conf.d/ cp $OTHERDIR/sysrq.conf $DEST/etc/sysctl.d/ +cp $OTHERDIR/81-blueman.rules $DEST/etc/polkit-1/rules.d/ echo "Installed rootfs to $DEST" diff --git a/otherfiles/81-blueman.rules b/otherfiles/81-blueman.rules new file mode 100644 index 00000000..e0c2e3c5 --- /dev/null +++ b/otherfiles/81-blueman.rules @@ -0,0 +1,8 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.blueman.rfkill.setstate" && subject.local && subject.active && subject.isInGroup("wheel")) { + return polkit.Result.YES; + } + if (action.id == "org.blueman.network.setup" && subject.local && subject.active && subject.isInGroup("wheel")) { + return polkit.Result.YES; + } +}); diff --git a/otherfiles/asound.state b/otherfiles/asound.state index 285da9a5..9168023d 100644 --- a/otherfiles/asound.state +++ b/otherfiles/asound.state @@ -2,7 +2,7 @@ state.Card { control.1 { iface MIXER name 'Headphone Playback Volume' - value 30 + value 59 comment { access 'read write' type INTEGER @@ -10,7 +10,7 @@ state.Card { range '0 - 63' dbmin -9999999 dbmax 0 - dbvalue.0 -3300 + dbvalue.0 -400 } } control.2 { @@ -27,7 +27,7 @@ state.Card { control.3 { iface MIXER name 'Line Out Playback Volume' - value 17 + value 10 comment { access 'read write' type INTEGER @@ -35,23 +35,24 @@ state.Card { range '0 - 31' dbmin -9999999 dbmax 0 - dbvalue.0 -2100 + dbvalue.0 -3150 } } control.4 { iface MIXER name 'Line Out Playback Switch' - value false + value.0 false + value.1 false comment { access 'read write' type BOOLEAN - count 1 + count 2 } } control.5 { iface MIXER name 'Mic1 Playback Volume' - value 1 + value 0 comment { access 'read write' type INTEGER @@ -59,7 +60,7 @@ state.Card { range '0 - 7' dbmin -450 dbmax 600 - dbvalue.0 -300 + dbvalue.0 -450 } } control.6 { @@ -102,6 +103,17 @@ state.Card { } } control.9 { + iface MIXER + name 'AIF1 Data Digital ADC Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.10 { iface MIXER name 'DAC Playback Switch' value.0 true @@ -112,7 +124,7 @@ state.Card { count 2 } } - control.10 { + control.11 { iface MIXER name 'DAC Reversed Playback Switch' value.0 false @@ -123,7 +135,7 @@ state.Card { count 2 } } - control.11 { + control.12 { iface MIXER name 'Mic1 Playback Switch' value.0 false @@ -134,7 +146,7 @@ state.Card { count 2 } } - control.12 { + control.13 { iface MIXER name 'Mixer Capture Switch' value.0 false @@ -145,7 +157,7 @@ state.Card { count 2 } } - control.13 { + control.14 { iface MIXER name 'Mixer Reversed Capture Switch' value.0 false @@ -156,7 +168,7 @@ state.Card { count 2 } } - control.14 { + control.15 { iface MIXER name 'Mic1 Capture Switch' value.0 false @@ -167,7 +179,7 @@ state.Card { count 2 } } - control.15 { + control.16 { iface MIXER name 'Headphone Source Playback Route' value.0 DAC @@ -180,11 +192,11 @@ state.Card { item.1 Mixer } } - control.16 { + control.17 { iface MIXER name 'Line Out Source Playback Route' - value.0 Stereo - value.1 Stereo + value.0 'Mono Differential' + value.1 'Mono Differential' comment { access 'read write' type ENUMERATED @@ -222,3 +234,297 @@ state.allwinnerhdmi { } } } +state.sun50ia64audio { + control.1 { + iface MIXER + name 'Headphone Playback Volume' + value 41 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 63' + dbmin -9999999 + dbmax 0 + dbvalue.0 -2200 + } + } + control.2 { + iface MIXER + name 'Headphone Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.3 { + iface MIXER + name 'Mic1 Playback Volume' + value 3 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -450 + dbmax 600 + dbvalue.0 0 + } + } + control.4 { + iface MIXER + name 'Mic1 Boost Volume' + value 4 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin 0 + dbmax 4200 + dbvalue.0 3300 + } + } + control.5 { + iface MIXER + name 'Mic2 Playback Volume' + value 3 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -450 + dbmax 600 + dbvalue.0 0 + } + } + control.6 { + iface MIXER + name 'Mic2 Boost Volume' + value 4 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin 0 + dbmax 4200 + dbvalue.0 3300 + } + } + control.7 { + iface MIXER + name 'ADC Gain Capture Volume' + value 3 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -450 + dbmax 600 + dbvalue.0 0 + } + } + control.8 { + iface MIXER + name 'Line In Playback Volume' + value 3 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + dbmin -450 + dbmax 600 + dbvalue.0 0 + } + } + control.9 { + iface MIXER + name 'Line Out Playback Volume' + value 16 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 31' + dbmin -9999999 + dbmax 0 + dbvalue.0 -2250 + } + } + control.10 { + iface MIXER + name 'Line Out Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.11 { + iface MIXER + name 'AIF1 Slot 0 Digital DAC Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.12 { + iface MIXER + name 'AIF1 Data Digital ADC Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.13 { + iface MIXER + name 'Headphone Source Playback Route' + value.0 DAC + value.1 DAC + comment { + access 'read write' + type ENUMERATED + count 2 + item.0 DAC + item.1 Mixer + } + } + control.14 { + iface MIXER + name 'Line Out Source Playback Route' + value.0 'Mono Differential' + value.1 'Mono Differential' + comment { + access 'read write' + type ENUMERATED + count 2 + item.0 Stereo + item.1 'Mono Differential' + } + } + control.15 { + iface MIXER + name 'DAC Playback Switch' + value.0 true + value.1 true + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.16 { + iface MIXER + name 'DAC Reversed Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.17 { + iface MIXER + name 'Line In Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.18 { + iface MIXER + name 'Mic1 Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.19 { + iface MIXER + name 'Mic2 Playback Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.20 { + iface MIXER + name 'Mixer Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.21 { + iface MIXER + name 'Mixer Reversed Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.22 { + iface MIXER + name 'Line In Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.23 { + iface MIXER + name 'Mic1 Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } + control.24 { + iface MIXER + name 'Mic2 Capture Switch' + value.0 false + value.1 false + comment { + access 'read write' + type BOOLEAN + count 2 + } + } +} diff --git a/otherfiles/pine64-first-boot.service b/otherfiles/pine64-first-boot.service deleted file mode 100644 index 4d9c7488..00000000 --- a/otherfiles/pine64-first-boot.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Pine A64 First boot -After=systemd-modules-load.service local-fs.target - -[Service] -Type=oneshot -ExecStart=/usr/local/sbin/pine64_first_boot.sh - -[Install] -WantedBy=multi-user.target diff --git a/otherfiles/pine64_first_boot.sh b/otherfiles/pine64_first_boot.sh deleted file mode 100755 index 63f719fd..00000000 --- a/otherfiles/pine64_first_boot.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -x - -mkdir -p /var/lib/pine64 - -if [ ! -e /var/lib/pine64/resized ]; then - touch /var/lib/pine64/resized - /usr/local/sbin/resize_rootfs.sh -fi