Created
April 19, 2015 03:03
-
-
Save evq/9ddac40ea11e0156719e to your computer and use it in GitHub Desktop.
Install opkg on rooted Wink hub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Wink Hub opkg bootstrap script | |
# curl -s http://wink.7pr.xyz/bootstrap.sh | bash | |
export BASE_URL=http://wink.7pr.xyz | |
if [ ! -f /sbin/ldconfig ]; then | |
curl -o /sbin/ldconfig $BASE_URL/bootstrap/ldconfig | |
chmod +x /sbin/ldconfig | |
fi | |
if ! grep /usr/local/lib /etc/ld.so.conf; then | |
echo /usr/local/lib >> /etc/ld.so.conf | |
cp /usr/lib/libcurl.so.4.3.0 /usr/lib/libcurl.bkup.4.3.0 | |
curl -o /tmp/libcurl.so.4.3.0 $BASE_URL/bootstrap/libcurl.so.4.3.0 | |
mv /tmp/libcurl.so.4.3.0 /usr/lib/libcurl.so.4.3.0 | |
chmod +x /usr/lib/libcurl.so.4.3.0 | |
fi | |
cd /tmp | |
curl -o opkg_0.2.4_arm.ipk $BASE_URL/opkg_0.2.4_arm.ipk | |
ar -x opkg_0.2.4_arm.ipk | |
/usr/bin/tar xvfz control.tar.gz | |
cd / | |
/usr/bin/tar xvfz /tmp/data.tar.gz | |
rm /tmp/control.tar.gz | |
rm /tmp/opkg_0.2.4_arm.ipk | |
rm /tmp/debian-binary | |
cp /etc/ld.so.cache /etc/ld.so.cache.bkup | |
ldconfig | |
mkdir -p /usr/lib/opkg/info | |
mv /tmp/control /usr/lib/opkg/info/opkg.control | |
/usr/bin/tar tfz /tmp/data.tar.gz > /usr/lib/opkg/info/opkg.list | |
sed -i 's/^\.//' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/$/d' /usr/lib/opkg/info/opkg.list | |
sed -i 's/\/$//' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/usr$/d' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/usr\/local$/d' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/usr\/local\/include$/d' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/usr\/local\/share$/d' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/usr\/local\/bin$/d' /usr/lib/opkg/info/opkg.list | |
sed -i '/^\/usr\/local\/lib$/d' /usr/lib/opkg/info/opkg.list | |
rm /tmp/data.tar.gz | |
echo Package: opkg >> /usr/lib/opkg/status | |
echo Version: 0.2.4 >> /usr/lib/opkg/status | |
echo Status: install user installed >> /usr/lib/opkg/status | |
echo Architecture: arm >> /usr/lib/opkg/status | |
echo Installed-Time: $(date "+%s") >> /usr/lib/opkg/status | |
mkdir -p /etc/opkg/ | |
echo src/gz wink $BASE_URL > /etc/opkg/opkg.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment