You are not logged in.
Can you modify your script to accommodate amd64 as well?
I think it may be worth bypassing the Debian packaging ecosystem completely with Flashplayer
At first I thought it would be better to "leave it up to Aunty Debian" wherever possible, but I'm coming round to your point of view.
An i386/amd64 version of the script, and BL Debian package, should be arriving soonish. It's not a huge extension of the code.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Can you modify your script to accommodate amd64 as well?
Sorry to keep you waiting.
The deb hasn't yet been updated, but here's a 32/64 version of the script.
#!/bin/bash
# update-bunsen-pepperflash: a script to check Adobe for
# possible upgrades of the pepperflash plugin for Linux,
# and offer to download and install.
#
# Copyright © 2016 John Crawley <john@bunsenlabs.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -u
HELP='A script to check Adobe for possible upgrades of the pepperflash plugin
for Linux, and offer to download and install.
Only for i386 and amd64 architectures,
and replaces the package pepperflashplugin-nonfree,
which must be uninstalled before use.
To use with Mozilla browsers,
browser-plugin-freshplayer-pepperflash must be installed.
This script is run automatically when the package bunsen-pepperflash
is installed, but may be run manually.
Options:
--help -h Show this message.
--status -s Show installed and upstream versions.
--install -i Install or upgrade the plugin from Adobe,
if upstream version is newer.
--uninstall -u Remove the plugin.
--upgrade -g Upgrade the plugin, only if it is currently installed.
To use options -i, -u and -g, run script as root.
Option -g is intended for non-interactive use:
STDOUT is quieter and important messages are sent via notify-send.
NOTE: If the plugin is uninstalled with the -u option,
it will still be reinstalled after a package upgrade.
To permanently uninstall the plugin, uninstall this package.
'
pkgname=bunsen-pepperflash
flashdir="/usr/lib/$pkgname" # Flash player will be installed here.
filename=libpepflashplayer.so
manifest=manifest.json
flash_file="$flashdir/$filename"
manifest_file="$flashdir/$manifest"
chromium_confdir='/etc/chromium.d/'
chromium_configfile="$chromium_confdir/$pkgname"
# config file for browser-plugin-freshplayer-pepperflash
freshwrapper_configfile='/etc/freshwrapper.conf'
required_commands=(curl wget awk strings)
error_exit() {
echo "$0 error: $1" >&2
exit 1
}
[[ $(dpkg-query --show --showformat='${db:Status-Abbrev;2}' pepperflashplugin-nonfree 2>/dev/null) = ii ]] && error_exit 'pepperflashplugin-nonfree must be uninstalled before using this script.'
case "$(dpkg --print-architecture)" in
i386)
arch='i386'
;;
amd64)
arch='x86_64'
;;
*)
error_exit 'There is no flash plugin available for your system architecture.'
;;
esac
missing_commands=()
for i in "${required_commands[@]}"
do
hash $i || missing_commands+=("$i")
done
[[ ${#missing_commands[@]} -eq 0 ]] || error_exit "This script requires the following commands: ${missing_commands[*]}
Please install the packages containing the missing commands
and rerun the script."
opt="${1-}"
quiet=false
check_root() {
[[ $( id -u ) -eq 0 ]] || error_exit "$opt: must be root to use this option"
}
check_versions(){
echo 'Checking Flash version available from Adobe...'
local awk_script='BEGIN {
RS="<td rowspan=\""
FS="</td>"
}
/Linux/ {
for(i=1;i<NF;i++)
if( $i ~ /Chromium-based browsers - PPAPI/ ) {
i++
sub(/^[^0-9]*/,"",$i)
print $i
exit
}
}'
newver=$(curl -s http://www.adobe.com/software/flash/about/ | awk "$awk_script")
echo "Upstream version: $newver"
if [[ -r $flash_file ]]
then
instver=$(strings "$flash_file" 2>/dev/null | sed -n '/LNX/ {s/^LNX //;s/,/./gp}')
echo "Installed version: $instver"
else
instver=''
echo "There is no installed file $flash_file"
return 0
fi
if dpkg --compare-versions "$newver" gt "$instver"
then
[[ ${quiet-} = true ]] || echo "The upstream version is newer."
return 0
else
[[ ${quiet-} = true ]] || echo "You already have the newest version."
return 1
fi
}
cleanup(){
[[ ${quiet-} = true ]] || echo 'Cleaning up...'
[[ -d $tempdir && $tempdir = /tmp/* ]] && {
rm -rf "$tempdir"
[[ ${quiet-} = true ]] || echo "Deleted $tempdir"
return 0
}
return 1
}
config_chromium(){
[[ ${quiet-} = true ]] || echo 'Configuring chromium...'
mkdir -p "$chromium_confdir" || error_exit "failed to make directory $chromium_confdir"
rm -f "$chromium_confdir/pepperflashplugin-nonfree"
cat <<EOF > "$chromium_configfile" || error_exit "failed to generate $chromium_configfile"
flashso="$flash_file"
flashversion=\$(strings \$flashso 2>/dev/null | sed -n '/LNX/ {s/^LNX //;s/,/./gp}')
CHROMIUM_FLAGS="\$CHROMIUM_FLAGS --ppapi-flash-path=\$flashso --ppapi-flash-version=\$flashversion"
EOF
}
config_freshwrapper(){
[[ ${quiet-} = true ]] || echo 'Configuring the freshplayer plugin...'
cat <<< "$freshwrapper_conf" > "$freshwrapper_configfile" || error_exit "failed to generate $freshwrapper_configfile"
}
install_flash(){
check_versions || return 0
[[ ${quiet-} = true ]] || echo 'Installing flash...'
tempdir="$(mktemp -d)" || error_exit 'failed to make temporary directory'
trap cleanup EXIT
local wget_opt=
[[ ${quiet-} = true ]] && wget_opt='-q'
wget ${wget_opt-} --directory-prefix="$tempdir" "https://fpdownload.adobe.com/pub/flashplayer/pdc/$newver/flash_player_ppapi_linux.$arch.tar.gz" || error_exit 'download failed'
tar -xf "$tempdir/flash_player_ppapi_linux.$arch.tar.gz" --directory "$tempdir" "$filename" "$manifest" || error_exit 'failed to unpack archive'
gotver=$(strings "$tempdir/$filename" 2>/dev/null | sed -n '/LNX/ {s/^LNX //;s/,/./gp}')
[[ "$gotver" = "$newver" ]] || error_exit "The version of the downloaded flash library does not seem to match that published on the Adobe site."
mkdir -p "$flashdir" || error_exit "failed to make directory $flashdir"
mv -f "$tempdir/$filename" "$tempdir/$manifest" "$flashdir" || error_exit "failed to move files to $flashdir"
config_chromium
config_freshwrapper
if [[ ${quiet-} = true ]] && hash bl-notify-broadcast
then
bl-notify-broadcast 'Flash upgrade' "The Adobe pepperflash plugin has been upgraded
from <b>$instver</b> to <b>$newver</b>" --icon=dialog-information --expire-time=20000
fi
}
upgrade_flash(){
[[ -r $flash_file ]] || {
echo "Flash plugin not currently installed"
return 0
}
install_flash
}
uninstall_flash(){
echo 'Uninstalling flash...'
rm -f "$flash_file" "$manifest_file"
rmdir --ignore-fail-on-non-empty "$flashdir" || true
rm -f "$chromium_configfile"
rm -f "$freshwrapper_configfile"
}
# contents of freshwrapper.conf
freshwrapper_conf="# Configuration options for FreshPlayerPlugin
# This configuration file is optional. Wrapper will search for it first
# in ~/.config/freshwrapper.conf, then in /etc/freshwrapper.conf.
# If wrapper fails to find configuration, it will use default values,
# which you can find below
# Audio buffer is used to continuously provide sound adapter with data.
# Values too low may lead to buffer underruns and stuttering. Values
# too high will lead to noticeable latency. Usually plugin selects size
# on its own, but you may override bounds here
# lower bound for audio buffer size, in milliseconds
audio_buffer_min_ms = 20
# higher bound of audio buffer size, in milliseconds
audio_buffer_max_ms = 500
# output sound through JACK. If enabled, only JACK will be tried, and if
# your machine doesn't have it, there would be no sound, and no sync
audio_use_jack = 0
# whenever to automatically connect application ports to system ones.
# If you set this to one, no sound would be produces until you make
# connection some way
jack_autoconnect_ports = 1
# JACK server name. Omit the option to use default value
#
# jack_server_name = \"default\"
# starts JACK server on demand
jack_autostart_server = 1
# Path to the Pepper Flash plugin.
# If the option is absent, freshwrapper will search for Pepper Flash in
# a number of locations where it could be. Usually that's enough, but if
# not, you should manually enter the right path. Multiple paths could
# be specified, separated by colon.
#pepperflash_path = \"/opt/google/chrome/PepperFlash/libpepflashplayer.so\"
########################################################################
## This line added by $0 ##
pepperflash_path = \"$flash_file\"
# \"Command-line\" arguments for Flash
flash_command_line = \"enable_hw_video_decode=1,enable_stagevideo_auto=1\"
# enable 3d and stage 3d
enable_3d = 1
# enable hardware-accelerated video decoding. Requires 3d to really work
enable_hwdec = 0
# when set to 1, limits output to warnings and errors only
quiet = 0
# When multiple monitors with different resolutions are used, size
# of fullscreen window can vary. But some Flash movies request these
# parameters once at startup and rely on them to be correct. By default,
# if zeros are used here, freshwrapper will select minimal width and
# height across all monitors.
fullscreen_width = 0
fullscreen_height = 0
# Enables DNS query case randomization to partially protect against DNS
# poisoning attacks. It was reported that some Mikrotik routers do not
# support this trick. Set parameter to 0 if you have an affected model
randomize_dns_case = 0
# scaling factor (floating point value) used to convert screen pixels
# to device independent pixels. You may need it for displays with
# high DPI
device_scale = 1
# method org.freedesktop.ScreenSaver.SimulateUserActivity() in KDE 5 seems
# to have no effect unless GetSessionIdleTime() called afterwards. Set
# parameter to 1 to call latter
quirk_plasma5_screensaver = 0
# whenever to use windowed plugin mode
enable_windowed_mode = 1
# whenever XEmbed used in windowed mode (if browser advertises its support)
enable_xembed = 1
# if set to 1, fullscreen window will be kept always above browser, and hidden
# from taskbar and pager
tie_fullscreen_window_to_browser = 1
# enable using of VA-API for hardware accelerated video decoding
enable_vaapi = 1
# enable using of VDPAU for hardware accelerated video decoding
enable_vdpau = 1
# microseconds to wait after vsync event
vsync_afterwait_us = 0
# fullscreen transition delay, in milliseconds
fs_delay_ms = 300
# wait for vertical blank event before drawing on screen
enable_vsync = 1
# how close in time two clicks should be to treat them as a doubleclick
double_click_delay_ms = 400
# show version and git commit hash (if was available) of freshwrapper
# in the context menu (right mouse button menu)
show_version_info = 0
# probe video capture devices for their names and capabilities
probe_video_capture_devices = 1
# use XRender to blend images
enable_xrender = 1
"
# end freshwrapper config
case $opt in
--help|-h)
echo "$HELP"
exit 0
;;
--install|-i)
check_root
install_flash
exit
;;
--uninstall|-u)
check_root
uninstall_flash
exit
;;
--upgrade|-g)
quiet=true
check_root
upgrade_flash
;;
--status|-s)
check_versions
exit
;;
'')
echo "$HELP"
exit 1
;;
*)
echo "$1: no such option
$HELP"
exit 1
;;
esac
The deb package will have to have its architecture settings in debian/control etc. tweaked too. Soonish.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Awesome stuff, thank you very much
I will test this on my jessie system at the earliest opportunity.
Offline
Trial deb packages on my Dropbox. (If you download directly with wget you'll get no login/joinup/signhere pestering.)
https://www.dropbox.com/s/hchsd47dm7hjq … _amd64.deb
https://www.dropbox.com/s/dqtm84oj54xi5 … t_i386.deb
Last edited by johnraff (2016-10-19 05:47:32)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Sorry for the delay...
The amd64 .deb installs and works on my Debian jessie system:
Checking Flash version available from Adobe...
Upstream version: 23.0.0.185
There is no installed file /usr/lib/bunsen-pepperflash/libpepflashplayer.so
Installing flash...
Very nice
And the icing on the proverbial cake:
root@jessie:~# systemctl list-unit-files | grep bunsen
bunsen-pepperflash.service static
bunsen-pepperflash.timer enabled
Great work John!
Offline
If you've got the latest bunsen-utilities installed you should also get a notification popup next time the Flash plugin is upgraded to a new version.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
^ Yes, I forgot about the notifications, I will add those as well and wait for the next update
This is on a Debian jessie system, is https://pkg.bunsenlabs.org/debian/pool/ … utilities/ the only package that is needed?
I'd rather not add foreign repositories...
8o
Offline
Yes bunsen-utilities 8.7.1-1 is all you need, along with its dependencies, which are all in the regular Debian or Bunsen repos.
Last edited by johnraff (2016-10-18 09:00:58)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
I haven't had internet for a while. Does downloading from Adobe and putting the .so file in -.mozilla/plugins still work for Firefox?
No, he can't sleep on the floor. What do you think I'm yelling for?!!!
Offline
If you mean the old PAAPI plugin, it should work (not sure about the exact dir path).
If you mean the new PPAPI it will need browser-plugin-freshplayer-pepperflash too. You can then put it in any of the directories b-p-f-p checks, or set a new path in /etc/freshwrapper.conf. For pepperflash, it's easier to install one of the experimental debs here: https://forums.bunsenlabs.org/viewtopic … 611#p38611 the new package bunsen-pepperflash, via apt-get.
Last edited by johnraff (2016-10-24 05:57:16)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
A quick update: the .timer seems to be working, no new Flash version is available yet...
root@jessie:~# journalctl -u bunsen-pepperflash.timer
-- Logs begin at Sun 2016-10-23 10:56:15 BST, end at Sun 2016-10-23 11:12:40 BST. --
Oct 23 10:56:25 jessie systemd[1]: Starting Run Adobe pepperflash upgrade check daily..
Oct 23 10:56:25 jessie systemd[1]: Started Run Adobe pepperflash upgrade check daily..
root@jessie:~# systemctl list-timers --no-pager
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2016-10-24 00:00:00 BST 12h left Sun 2016-10-23 06:26:27 BST 4h 46min ago bunsen-pepperflash.timer bunsen-pepperflash.service
Mon 2016-10-24 11:11:23 BST 23h left Sun 2016-10-23 11:11:23 BST 1min 34s ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
2 timers listed.
Pass --all to see loaded but inactive timers, too.
root@jessie:~#
EDIT: what the **** was $DEPENDENT_MINOR doing on the laptop at 6.30am on a Sunday morning?
Busted...
Last edited by Head_on_a_Stick (2016-10-23 21:34:43)
Offline
the .timer seems to be working, no new Flash version is available yet...
I think one came in last week or so, but there was a wait of several weeks before that. They aren't all that frequent.
EDIT 2016/10/31: an upgrade came in a couple of days ago (to 23.0.0.205) and a popup duly appeared on my desktop.
Last edited by johnraff (2016-10-31 01:31:08)
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Thanks for your .deb @johnraff, without it I was unable to use pepperflash at all. It certainly need to be part of new distro version
Offline
@Narmo - glad it worked for you.
In fact, the deb is now in the regular BunsenLabs repository, so any BL user can install it by running
sudo apt-get install bunsen-pepperflash
It won't be part of any future BL system by default because not all users will want it, but the new version of bunsen-welcome will offer to install it.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline