#!/bin/sh # # by areq 2024-10 # DEST="$1" if [ "${#DEST}" -lt 3 ]; then echo $0 dir - podaj istniejacy katalog do chroot exit fi DEST="$(readlink -f $DEST)" if [ ! -d "$DEST" ]; then echo "Katalog $DEST - musi istniec" exit fi if [ "$(ls -A "$DEST")" ]; then echo "Katalog $DEST - musi byc pusty" exit fi if [ -f /bin/busybox ]; then TAR="/bin/busybox tar" else TAR="tar" fi echo "Start creating chroot in $DEST" wget https://downloads.openwrt.org/releases/18.06.9/targets/armvirt/32/openwrt-18.06.9-armvirt-32-default-rootfs.tar.gz -O /tmp/rootfs.tar.gz cd "$DEST" $TAR xzpf /tmp/rootfs.tar.gz rm -f /tmp/rootfs.tar.gz rm -f "${DEST}/etc/resolv.conf" echo "nameserver 1.1.1.1" > "${DEST}/etc/resolv.conf" mkdir -p "${DEST}/var/lock/" "${DEST}/var/run/" chroot "$DEST" /bin/sh -c "opkg update; opkg install libopenssl libusb-1.0 libpcsclite pcscd ccid pcsc-tools" rm "${DEST}/var/opkg-lists/op*" wget http://areq.eu.org/e2/oscam/arm-openwrt/oscam-CyCeCpl-11823-arm-openwrt-linux-muslgnueabi-ssl-libusb-pcsc -O "$DEST/bin/oscam" wget http://areq.eu.org/e2/oscam/arm-openwrt/run.sh -O "$DEST/run.sh" chmod +x "$DEST/bin/oscam" "$DEST/run.sh" chroot "$DEST" /bin/oscam -V echo echo OK echo "Dodaj do automatycznego uruchamiania: $DEST/run.sh" echo