Skip to content

gpd-pocket3 fix for ubuntu 23.04 #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/20-gpd-pocket3-intel.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# https://bugs.launchpad.net/ubuntu/+source/skype/+bug/1078068
# "blue screen" video issue
Section "Extensions"
Option "XVideo" "Disable"
EndSection

Section "Device"
Identifier "Device0"
Driver "intel"
Expand Down
2 changes: 1 addition & 1 deletion data/99-gpd-pocket3-touch.rules
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ACTION=="add", KERNEL=="event[0-9]*", ATTRS{name}=="GXTP7380:00 27C6:0113", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1"
#ACTION=="add", KERNEL=="event[0-9]*", ATTRS{name}=="GXTP7380:00 27C6:0113", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1"
ACTION=="add", KERNEL=="event[0-9]*", ATTRS{name}=="GXTP7380:00 27C6:0113 Stylus", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1"
3 changes: 2 additions & 1 deletion data/umpc-display-rotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ static const char touchy[][48] = {
};

static const char screens[][8] = {
"DSI1" //GPD Pocket 3 & TopJoy Falcon
"DSI1", //GPD Pocket 3 & TopJoy Falcon
"DSI-1" //GPD Pocket 3 & TopJoy Falcon
};

#define RADIANS_TO_DEGREES 180.0/M_PI
Expand Down
68 changes: 47 additions & 21 deletions umpc-ubuntu-respin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ fi

MNT_IN="${HOME}/iso_in"
MNT_OUT="${HOME}/iso_out"
SQUASH_IN="${MNT_IN}/casper/filesystem.squashfs"
SQUASH_OUT="${MNT_OUT}/casper/squashfs-root"
XORG_CONF_PATH="${SQUASH_OUT}/usr/share/X11/xorg.conf.d"
INTEL_CONF="${XORG_CONF_PATH}/20-${UMPC}-intel.conf"
Expand Down Expand Up @@ -148,21 +147,12 @@ else
fi
fi

if [ -f "${MNT_IN}/.disk/info" ] && [ -f "${MNT_IN}/casper/filesystem.squashfs" ]; then

if [ -f "${MNT_IN}/.disk/info" ] ; then
FLAVOUR=$(cut -d' ' -f1 < "${MNT_IN}/.disk/info")
VERSION=$(cut -d' ' -f2 < "${MNT_IN}/.disk/info")
CODENAME=$(cut -d'"' -f2 < "${MNT_IN}/.disk/info")
echo "Modifying ${FLAVOUR} ${VERSION} (${CODENAME}) for the ${UMPC}"

rsync -aHAXx --delete --quiet \
--exclude=/casper/filesystem.squashfs \
--exclude=/casper/filesystem.squashfs.gpg \
--exclude=/md5sum.txt \
"${MNT_IN}/" "${MNT_OUT}/" 2>&1 >/dev/null

# Extract the contents of the squashfs
unsquashfs -f -d "${SQUASH_OUT}" "${SQUASH_IN}"
umount -l "${MNT_IN}"
else
echo "ERROR! This doesn't look like an Ubuntu iso image."
umount -l "${MNT_IN}"
Expand All @@ -176,11 +166,39 @@ case ${VERSION} in
echo "ERROR! Only Ubuntu 20.04 or newer is supported."
exit 1
;;
20*|22*)
CASPER_FS=filesystem
;;
24*)
CASPER_FS=minimal
;;
esac

SQUASH_IN="${MNT_IN}/casper/${CASPER_FS}.squashfs"

if [ -f "${MNT_IN}/casper/${CASPER_FS}.squashfs" ]; then
rsync -aHAXx --delete --quiet \
--exclude="/casper/${CASPER_FS}.squashfs" \
--exclude="/casper/${CASPER_FS}.squashfs.gpg" \
--exclude=/md5sum.txt \
"${MNT_IN}/" "${MNT_OUT}/" 2>&1 >/dev/null

# Extract the contents of the squashfs
unsquashfs -f -d "${SQUASH_OUT}" "${SQUASH_IN}"
umount -l "${MNT_IN}"
else
echo "ERROR! This doesn't look like an Ubuntu iso image."
umount -l "${MNT_IN}"
clean_up
exit 1
fi

# Some device have require specific Ubuntu releases.
case "${UMPC}" in
gpd-pocket3)
# Enable Intel SNA, DRI1/3 and TearFree.
inject_data "${INTEL_CONF}"

case ${VERSION} in
20*|21.04)
echo "ERROR! GPD Pocket 3 is only supported by Ubuntu 21.10 and newer."
Expand Down Expand Up @@ -210,18 +228,26 @@ inject_data "${MONITORS_XML}"
# Scroll while holding down the right track point button
inject_data "${TRACKPOINT_CONF}"

# Rotate the touchscreen.
inject_data "${TOUCH_RULES}"

# Configure kernel modules
inject_data "${MODPROBE_CONF}"

# Apply device specific gschema overrides
inject_data "${GSCHEMA_OVERRIDE}"

# Add device specific /etc/grub.d configuration
inject_data "${GRUB_D_CONF}"

# Rotate the touchscreen.
inject_data "${TOUCH_RULES}"


case ${UMPC} in
gpd-pocket3)
;;
*)
# Configure kernel modules
inject_data "${MODPROBE_CONF}"
;;
esac


# Device specific tweaks
case ${UMPC} in
gpd-pocket)
Expand Down Expand Up @@ -370,11 +396,11 @@ esac
#echo

# Update filesystem size
du -sx --block-size=1 "${SQUASH_OUT}" | cut -f1 > "${MNT_OUT}/casper/filesystem.size"
du -sx --block-size=1 "${SQUASH_OUT}" | cut -f1 > "${MNT_OUT}/casper/${CASPER_FS}.size"

# Repack squahsfs
rm -f "${MNT_OUT}/casper/filesystem.squashfs" 2>/dev/null
mksquashfs "${SQUASH_OUT}" "${MNT_OUT}/casper/filesystem.squashfs"
rm -f "${MNT_OUT}/casper/${CASPER_FS}.squashfs" 2>/dev/null
mksquashfs "${SQUASH_OUT}" "${MNT_OUT}/casper/${CASPER_FS}.squashfs"
echo "Cleaning up..."
echo " - ${SQUASH_OUT}"
rm -rf "${SQUASH_OUT}"
Expand Down