Skip to content

Commit

Permalink
Merge pull request #58 from Olf0/for-sfos340
Browse files Browse the repository at this point in the history
Update 2023/Q1
  • Loading branch information
Olf0 authored Feb 16, 2023
2 parents e9744ff + a037d84 commit e7981d9
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 38 deletions.
32 changes: 11 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -457,37 +457,27 @@ DAMAGES.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Libraries
Name of this software: mount-sdcard
WWW-Link to this software: https://github.com/Olf0/mount-sdcard

If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
Copyright (C) 2018-2023 olf <[email protected]>

To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

mount-sdcard
Copyright (C) 2018 - 2021+ olf

This library is free software; you can redistribute it and/or
This software is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.

This library is distributed in the hope that it will be useful,
This software 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
Lesser General Public License for more details.
Lesser General Public License version 2.1 (LGPLv2.1) for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
License along with this software; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA

https://github.com/Olf0/mount-sdcard/

WWW-link to this license: https://spdx.org/licenses/LGPL-2.1-only.html
Original source of this license in the WWW:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1-standalone.html

That's all there is to it!

18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# mount-sdcard
#### Enhanced mounting scripts for SD-cards under SailfishOS
### Enhanced mounting scripts for SD-cards for SailfishOS

This systemd unit file and the udev rules file are by-products of optimising the start-up timing, feature set and shut-down behavior of [crypto-sdcard](https://github.com/Olf0/crypto-sdcard).
This systemd unit file and the udev rules file are by-products of optimising the start-up timing, feature set and shut-down behaviour of [crypto-sdcard](https://github.com/Olf0/crypto-sdcard).

They provide the following enhancements compared to SailfishOS' original versions:
* Start mounting (partitions on) SD-card via udisks at the earliest sensible time: Right after *udisks2.service* has started.
* Unmount before *udisks2.service* begins stopping, hence achieving a clean unmount.
* Also do not use SailfishOS' *udisksctl-user* script for unmounting (because this cannot work at the time ExecStop is executed), which is installed and used by SailfishOS since its release 3.2.1, and was also used by *mount-sdcard* versions 1.1-1 to 1.3.0; see [details here](https://github.com/Olf0/mount-sdcard/pull/2).
* Ensure, that AlienDalvik (specifically *alien-service-manager.service*) begins starting after mounting succeeded, to allow for [android_storage on SD-card](https://together.jolla.com/question/203539/guide-externalising-android_storage-and-other-directories-files-to-sd-card/#203539-2-externalising-homenemoandroid_storage).<br />
Even more importantly (i.e., also relevant for devices without "android_storage on SD-card") this also ensures, that unmounting occurs only after AlienDalvik has completely stopped.<br />
Nevertheless, these configuration files are also applicable to devices without AlienDalvik installed.
* Ensure, that Alien&nbsp;Dalvik (specifically *alien-service-manager.service*) begins starting after mounting succeeded, to allow for [android_storage on SD-card](https://together.jolla.com/question/203539/guide-externalising-android_storage-and-other-directories-files-to-sd-card/#203539-2-externalising-homenemoandroid_storage).<br />
Even more importantly (i.e., also relevant for devices without "android_storage on SD-card") this also ensures, that unmounting occurs only after Alien&nbsp;Dalvik has completely stopped.<br />
Nevertheless, these configuration files are also applicable to devices without Alien&nbsp;Dalvik installed.
* Since [v1.3.4](https://github.com/Olf0/mount-sdcard/releases/tag/1.3.2), overhauled in [v1.5.1](https://github.com/Olf0/mount-sdcard/blob/1e17ec4854c44ab2dd498b956c1a3ac280668952/systemd/system/mount-sd.conf): Use [Systemd EnvironmentFiles](https://www.freedesktop.org/software/systemd/man/systemd.exec.html#EnvironmentFile=), allowing administrators to [easily set options](https://github.com/Olf0/mount-sdcard/blob/master/systemd/system/mount-sd.conf#L2).
* Versions below 1.0-4, plus the 1.x.y-z.sfos220 versions: Inhibit stubbornly trying to mount block devices without a filesystem recognised by the kernel / udev.<br />
As Jolla resolved this in SailfishOS 3.0.1 (see [commit](https://git.sailfishos.org/mer-core/udisks2/commit/6fae1738440d65deb995edb0e5d759c74729d00b) and [changelog](https://together.jolla.com/question/195733/changelog-301-sipoonkorpi/#195733-udisks2)), this workaround is omitted in *mount-sdcard 1.0-4* (and later versions), making [*v1.0-3*](https://github.com/Olf0/mount-sdcard/releases/tag/1.0-3) and the *v1.x.y-z.sfos220* versions the latest releases installable on SailfishOS 2.2.0, 2.2.1 and 3.0.0.
As Jolla resolved this in SailfishOS 3.0.1 (see [commit](https://git.sailfishos.org/mer-core/udisks2/commit/6fae1738440d65deb995edb0e5d759c74729d00b) and [changelog](https://together.jolla.com/question/195733/changelog-301-sipoonkorpi/#195733-udisks2)), this workaround is omitted in *mount-sdcard 1.0-4* (and later versions), but retained in the *v1.x.y-z.sfos220* versions for SailfishOS 2.2.0, 2.2.1 and 3.0.0.
* Versions below 1.0: Create / try to rectify the "compatibility symlink" in order to allow older apps seamlessly accessing (partitions on) SD-cards at their new (since SailfishOS 2.2.0) mount point.

Notes:
* These configuration files do not alter, replace or delete any extant files.
* These configuration files do not alter, replace, move or delete any extant files.
* Minimal SailfishOS version supported by *mount-sdcard* is 2.2.0.
* For *mount-sdcard 1.0-4* and the *1.x.y-z.sfos301* versions at least [SailfishOS 3.0.1](https://github.com/Olf0/mount-sdcard/releases/tag/1.0-4) is required.
* For *mount-sdcard 1.1-1* to *1.4.0* and the *1.x.y-z.sfos321* versions at least [SailfishOS 3.2.1](https://github.com/Olf0/mount-sdcard/pull/2) is required.
* For the *1.x.y-z.sfos301* versions (and *mount-sdcard 1.0-4*) at least [SailfishOS 3.0.1](https://github.com/Olf0/mount-sdcard/releases/tag/1.0-4) is required.
* For the *1.x.y-z.sfos321* versions (and *mount-sdcard 1.1-1* to *1.4.0*) at least [SailfishOS 3.2.1](https://github.com/Olf0/mount-sdcard/pull/2) is required.
* Support of partitions and whole devices (as SailfishOS' original versions do).
* Support for (µ)SD-cards and USB-attached storage (if supported by device hardware and Operating System).
* An RPM built for SailfishOS is available at [OpenRepos](https://openrepos.net/content/olf/mount-sdcard).
40 changes: 32 additions & 8 deletions rpm/mount-sdcard.spec
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
Name: mount-sdcard
Summary: Enhanced mounting scripts for SD-cards
Version: 1.8.1
Summary: Enhanced mounting scripts for media as SD-cards
Version: 1.8.2
# Since v1.4.2, the release version consists of two or three fields, separated by a dot ("."):
# - The first field must contain a natural number greater than zero.
# This number may be prefixed by one of {alpha,beta,rc,stable}, e.g. "alpha13".
# This number may be prefixed by one of {alpha,beta,rc,release}, e.g. "alpha13".
# - The second field indicates the minimal required SailfishOS version A.B.C.X in the format "sfosABC";
# the fourth field of a SailfishOS version ("X") is neither depended upon or denoted.
# - An optional third field might be used by downstream packagers, who alter the package but want to
# retain the exact version number. It shall consist of the packager's name appended with a natural
# number greater than zero, e.g "joe8".
# retain the exact version number. It should consist of the packager's name appended with a natural
# number greater than zero as the packaging release number, e.g "joe8".
Release: 1.sfos340
Group: System/Base
Distribution: SailfishOS
Vendor: olf
Packager: olf
License: LGPL-2.1-only
URL: https://github.com/Olf0/%{name}
Source: https://github.com/Olf0/%{name}/archive/%{version}-%{release}/%{name}-%{version}-%{release}.tar.gz
# Download URLs for gzipped tarballs at GitHub must conform to: %{url}/archive/<tag-name>/<arbitrary-string>.tar.gz
Source: %{url}/archive/%{version}-%{release}/%{name}-%{version}.tar.gz
# rpmbuild (as of v4.14.1) handles the Icon tag awkwardly and in contrast to the Source tag(s):
# It only accepts a GIF or XPM file (a path is stripped to its basename) in the SOURCES directory
# (but not inside a tarball there)! Successfully tested GIF89a and XPMv3, but an XPM icon results
Expand All @@ -34,10 +35,30 @@ Requires: sailfish-version >= 3.4.0
# Requires: sailfish-version < 9.9.9

%description
%{summary}
%{summary}, USB-attached storage etc.

%if 0%{?_chum}
PackageName: %{name}
Type: generic
Categories:
- Utilities
- System
DeveloperName: olf (Olf0)
Custom:
Repo: %{url}
Icon: %{url}/raw/master/icon/smartmedia_unmount.256x256.png
Url:
Homepage: https://openrepos.net/content/olf/%{name}
Help: %{url}/issues
Bugtracker: %{url}/issues
Donation: https://openrepos.net/donate
%endif

%define _binary_payload w6.gzdio
%define _source_payload w2.gzdio

%prep
%setup -n %{name}-%{version}-%{release}
%setup -q

%build

Expand All @@ -52,3 +73,6 @@ cp -R polkit-1 systemd udev %{buildroot}%{_sysconfdir}/
%{_sysconfdir}/polkit-1/localauthority/50-local.d/61-mountsd.pkla
%config %{_sysconfdir}/systemd/system/mount-sd.conf

%changelog
* Thu Sep 9 1999 olf <[email protected]> - 99.99.99
- See %{url}/releases

0 comments on commit e7981d9

Please sign in to comment.