Author Topic: Repo On Sd  (Read 2246 times)

benplaut

  • Full Member
  • ***
  • Posts: 113
    • View Profile
Repo On Sd
« on: July 29, 2005, 04:49:28 am »
is there a way to make a repo on an SD/CF card? it would be nice to be able to make a repo on the desktop, put it on the SD, and transfer it over- so i don't have to deal with dependency hell until i get a WiFi card

possible? any tips?

thanks,
Ben  

rgrep

  • Full Member
  • ***
  • Posts: 149
    • View Profile
Repo On Sd
« Reply #1 on: July 29, 2005, 09:43:47 am »
Hi Ben,

It's pretty easy to set up a local feed on an SD or CF card.  The steps go something like this:

1. First thing you need to do create a directory for your feed, e.g. /mnt/card/feed.

2. Add an IPK file or two to the feed directory to get started.

3. You'll need to create a Packages file for ipkg to load.  The Packages file contains the descriptions of all the IPKs in your feed.  The easiest way is to have one automatically built for you by a script.  See below for the script I use or download the attachment.  You'll need to run the script everytime you add a new IPK file.  If you're not using /mnt/card/feed as your directory make sure you edit the top line of the script first.

4. Open up the Package Manager and add a new feed with the URL pointing to the directory you just made, e.g. file:///mnt/card/feed.  Click the "Reload package list" icon and you should see your feed's packages in the list.  Everytime you add new packages, after running the update-local-feed script, you'll need to either click the reload button in the Package Manager or type 'ipkg update' in a terminal so that ipkg will reload your Packages file.

I hope this all makes sense.  Let me know if you need any more help.

Cheers,

Matt

/usr/local/bin/update-local-feed:
Code: [Select]
#!/bin/sh
#

feed_dir=/mnt/card/feed

update () {

    echo "Updating $1:"
    
    if [ $# -lt 1 ]; then
  echo "`basename $0`: update() called without directory argument!"
  exit 1
    else
  if [ ! -d $1 ]; then
      echo "`basename $0`: update() called on non-existant directory!"
      exit 1
  fi
    fi
    
    cd $1

    if ! echo *.ipk | grep -q '^\*'; then
  echo -n "Removing Packages..."
  rm -f Packages
  echo " done."

  for file in *.ipk; do
      echo -n "Adding $file..."
      tar xzOf $file ./control.tar.gz | tar xzOf - ./control | sed 's/ $//' >> Packages
      echo >> Packages
      echo " done."
  done
    else
      echo "No ipk files found."
      echo -n "Creating blank Packages file..."
      >Packages
      echo " done."
    fi

    echo
}

update $feed_dir
[img]https://www.oesf.org/forums/style_emoticons/default/smile.gif\" border=\"0\" class=\"linked-sig-image\" /] Has: Dynamism C760 / Linksys WCF12 WiFi / Kingston 512MB SD
[img]https://www.oesf.org/forums/style_emoticons/default/biggrin.gif\" border=\"0\" class=\"linked-sig-image\" /] Loves: pdaXrom / Warwalking
[img]https://www.oesf.org/forums/style_emoticons/default/sad.gif\" border=\"0\" class=\"linked-sig-image\" /] Hates: NetGear MA701 WiFi / SanDisk 256MB SD / C760 Charging Faults