ubuntuusers.de

Anpassung einer Skriptdatei.

Status: Ungelöst | Ubuntu-Version: Ubuntu MATE 18.04 (Bionic Beaver)
Antworten |

mg42-a64dx86

Anmeldungsdatum:
13. Juni 2010

Beiträge: 70

Moin allerseits,

Zusatz, ich benutze gerade die oben genannte Ubuntuversion auf der Plammform armhf.

Das Skript welches ich verwenden möchte https://gist.github.com/ruario/19a28d98d29d34ec9b184c42e5f8bf29

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh -eu

# Make sure we have wget or curl
available () {
  command -v "$1" >/dev/null 2>&1
}
if available wget; then
  DL="wget -O-"
  DL_SL="wget -qO-"
elif available curl; then
  DL="curl -L"
  DL_SL="curl -s"
else
  echo "Install Wget or cURL" >&2
  exit 1
fi

# Find a URL to a suitable armhf ChromeOS recovery image
CHROMEOS_URL="$($DL_SL https://dl.google.com/dl/edgedl/chromeos/recovery/recovery.conf | grep -A11 CB5-312T | sed -n 's/^url=//p')"
CHROMEOS_IMG="$(basename "$CHROMEOS_URL" .zip)"
if [ -e "$CHROMEOS_IMG" ]; then
  CHROMEOS_IMG_PATH="./"
  DEL_IMG=N
else
  CHROMEOS_IMG_PATH="$(mktemp -td ChromeOS-IMG.XXXXXX)"
  DEL_IMG=Y
  # Fetch the recovery image (2Gb+ on disk after download)
  $DL "$CHROMEOS_URL" | zcat > "$CHROMEOS_IMG_PATH/$CHROMEOS_IMG"
fi

# Note the next free loop device in a variable
LOOPD="$(losetup -f)"

# If root, we can mount silently (no popup windows after mount)
if [ "$USER" = "root" ]; then
  MNTPNT="$(mktemp -d -t ChromeOS.XXXXXX)"
  losetup -Pf "$CHROMEOS_IMG_PATH/$CHROMEOS_IMG"
  mount -o ro "${LOOPD}p3" "$MNTPNT"
else
  # Associate all the partitions on the disk image with loop devices:
  udisksctl loop-setup -rf "$CHROMEOS_IMG_PATH/$CHROMEOS_IMG"
  sleep 1
  # Mount the third partition of the disk image (if the previous did not do it automatically)
  if ! lsblk -lo MOUNTPOINT "${LOOPD}p3" | tail -n1 | grep -q \.; then
    udisksctl mount -b "${LOOPD}p3"
  fi
  # Note the mount point in a variable
  MNTPNT="$(lsblk -lo MOUNTPOINT "${LOOPD}p3" | tail -n1)"
fi

# Copy over files and make manifest
CHRFILES="$(mktemp -d -t ChromeOS_Files.XXXXXX)"
install -Dm644 "$MNTPNT"/opt/google/chrome/pepper/libpepflashplayer.so "$CHRFILES"/opt/google/chrome/PepperFlash/libpepflashplayer.so
install -Dm644 "$MNTPNT"/opt/google/chrome/libwidevinecdm.so "$CHRFILES"/opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so
WVVER="$(grep -Eaom1 '([0-9]+\.){3}[0-9]+' "$CHRFILES"/opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so)"
WVMGR="$(echo $WVVER | cut -d. -f1)"
WVMIN="$(echo $WVVER | cut -d. -f2)"
echo "{\"version\":\"$WVVER\",\"x-cdm-codecs\":\"vp8,vp9.0,avc1,av01\",\"x-cdm-host-versions\":\"$WVMIN\",\"x-cdm-interface-versions\":\"$WVMIN\",\"x-cdm-module-versions\":\"$WVMGR\"}" > "$CHRFILES"/opt/WidevineCdm/manifest.json

# Extract the libs out and copy them to a compressed tar archive
ARCHIVE_NAME="widevine-flash-$(date '+%Y%m%d')_armhf.tgz"
echo "Extracting and compressing files"
tar -C"$CHRFILES" -caf "$ARCHIVE_NAME" opt/WidevineCdm/manifest.json opt/WidevineCdm/_platform_specific/linux_arm/libwidevinecdm.so opt/google/chrome/PepperFlash/libpepflashplayer.so --format ustar --owner 0 --group 0
rm -r "$CHRFILES"
echo "Created: $ARCHIVE_NAME"

# Cleanup
if [ "$USER" = "root" ]; then
  umount "$MNTPNT"
  losetup -d "$LOOPD"
  rmdir "$MNTPNT"
else
  ALLMNTS="$(lsblk -lo NAME,MOUNTPOINT "$LOOPD" | sed -n '/\//s/^\(loop[0-9]\+p[0-9]\+\).*/\1/p')"
  echo "$ALLMNTS" | xargs -I{} -n1 udisksctl unmount -b /dev/{}
  if [ "$LOOPD" != "$(losetup -f)" ]; then
    udisksctl loop-delete -b "$LOOPD"
  fi
fi
if [ "$DEL_IMG" = "N" ] || [ "${1:-EMPTY}" = "-k" ]; then
  :
else
  rm "$CHROMEOS_IMG_PATH/$CHROMEOS_IMG"
  rmdir -v "$CHROMEOS_IMG_PATH"
fi

# Inform the user how to proceed
cat <<EOF

To install the contents of these files on an ARMhf device, copy the tar archive over to the target machine and issue the following:

  sudo tar Cfx / $ARCHIVE_NAME

After install of these libraries, issue the following two commands and restart Vivaldi:

  mkdir -p ~/.config/vivaldi/WidevineCdm
  echo '{"Path":"/opt/WidevineCdm"}' > ~/.config/vivaldi/WidevineCdm/latest-component-updated-widevine-cdm

EOF

dazu gedacht die entsprechenden Bibliotheken für widevine zu extrahieren und für diesen "PC" hier netflix nutzbar zu machen.

Problem: Meine Partition (rootverzeichnis bzw. der kryptische Ordner STDOUT) ist zu klein, bzw. der Ordner der dafür angelegt wird zu groß. Speicherplatz (extern) habe ich genug nur nicht eben auf der vom Skript her gedachten Partition.

Ich möchte dem ganzen einen festen Ordner zuweisen, in dem der Download (chromeos) gespeichert wird (der temporäre Ordner gespeichert) und von dem für die Extraktion gemountet wird, sowie den finalen Ordner in dem das Extrahierte gesichert wird.

frostschutz

Avatar von frostschutz

Anmeldungsdatum:
18. November 2010

Beiträge: 7825

Da wird mktemp verwendet, mit etwas Glück reicht es aus, TMPDIR zu setzen.

cd /mnt/extern # wo auch immer du Platz hast
mkdir tmp
TMPDIR=/mnt/extern/tmp /pfad/zum/script
Antworten |