diff --git a/Makefile b/Makefile index e6eb816..a419b8f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -RELEASE_VERSION = v1.15 +RELEASE_VERSION = v1.16 VERSION = latest OPTIONS = \ diff --git a/README.md b/README.md index b88189f..376d81d 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ $ docker run --rm jam7/narou > narou $ chmod a+x narou ``` -Don't add `-ti` to `docker run`. Otherwise, you may create a narou -script with crlf. +Don't add `-ti` to `docker run`. Otherwise, your narou script may contains +crlf. Run a generated script to download AozoraEpub3 to `$HOME/.narou/AozoraEpub3*` and initialize environment for narou.rb. @@ -66,7 +66,7 @@ From WSL2, perform mount first. ``` $ sudo mkdir -p /mnt/Kindle -$ sudo mount -t drvfs D: /mnt/Kindle +$ sudo mount -t drvfs d:/ /mnt/Kindle ``` Then, use `narou send`. @@ -75,10 +75,15 @@ Then, use `narou send`. $ narou send ``` -Unmount them. This may takes for a while. +Unmount them. It is required to run umount three times on Ubuntu-20.04 with +WSL2. ``` -$ sudo umount /mnt/Kindle +$ sudo umount d:/ +$ sudo umount d:/ +$ sudo umount d:/ +$ sudo umount d:/ +umount: d:/: no mount point specified. ``` ### Run as web service (not tested recently) diff --git a/narou.sh b/narou.sh index e1e8a4f..88a43fb 100755 --- a/narou.sh +++ b/narou.sh @@ -54,11 +54,23 @@ xinit) ;; esac +if [ -d /mnt/Kindle/documents ]; then + MNT_KINDLE_OPT="-v" + MNT_KINDLE="/mnt/Kindle/documents:/mnt/Kindle/documents" +else + MNT_KINDLE_OPT="" + MNT_KINDLE="" +fi + # Need to mount docker.sock in order to use jam7/kindlegen docker image. +# Need to mount kindle device also. +# '-v /mnt/Kindle:/mnt/Kindle' rarely works. +# '-v /mnt/Kindle/documents:/mnt/Kindle/documents' works. +# Related issue: https://github.com/docker/for-win/issues/2151 docker run $TTY --rm $opt \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $data:/opt/narou \ - -v /mnt/Kindle/:/mnt/Kindle \ + $MNT_KINDLE_OPT $MNT_KINDLE \ -e NAROU_UID="$( id -u )" \ -e NAROU_GID="$( id -g )" \ -e NAROU_USER="$( id -un )" \