script hack to get dpkg working

8 views
Skip to first unread message

John Otto

unread,
Nov 25, 2008, 10:27:39 PM11/25/08
to pyrami...@googlegroups.com
Hi all,

I noticed someone was asking about apt-get support. I've hacked
together a script to get dpkg working. It doesn't give the spiffy
auto-downloading functionality of apt-get, but you can install
individual .deb packages, and dpkg will check dependencies. I've used
it to get Java, Bluetooth and ifplugd working.

The script's copied below. Note that this worked for the previous beta
(pyramid-1.0b5.img.gz), but I haven't tried it with the new release.
You'll need to get the dpkg .deb file from the Debian package server
(e.g. http://http.us.debian.org/debian/pool/main/d/dpkg/dpkg_1.13.25_i386.deb).

I installed this with the image mounted in my Linux machine, hence the
reference to $MOUNT_POINT and the "--root $MOUNT_POINT" arguments to
dpkg. To give it a try on a Pyramid installation, I've modified it and
copied it a second time below...

I suggest trying this on a non-critical machine :) just in case. No
warranties/guarantees/promises that it won't break something!

Hope this helps,
John

#!/bin/bash
#Run with the image mounted at $MOUNT_POINT
ar x dpkg.deb
mv data.tar.gz $MOUNT_POINT
rm debian-binary control.tar.gz
cd $MOUNT_POINT
tar xzf data.tar.gz
rm data.tar.gz
touch $MOUNT_POINT/var/lib/dpkg/status
touch $MOUNT_POINT/var/lib/dpkg/available
touch $MOUNT_POINT/var/lib/dpkg/info/dpkg.list
cd ..
ls $MOUNT_POINT/usr/share/doc | grep -v [A-Z] | \
grep -v '^texmf$' | grep -v '^debian$' | \
awk '{print $1 " install"}' | \
dpkg --set-selections --root $MOUNT_POINT
head -2 $MOUNT_POINT/var/lib/dpkg/status > temp
cat temp > $MOUNT_POINT/var/lib/dpkg/status
rm temp
sed -i 's/not-installed/installed/' $MOUNT_POINT/var/lib/dpkg/status
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' $MOUNT_POINT/var/lib/dpkg/status
echo 'Version: 1.13.21

' >> $MOUNT_POINT/var/lib/dpkg/status


-------------------------------------------------------


#!/bin/bash
#Version to run in Pyramid
ar x dpkg.deb
mv data.tar.gz /
rm debian-binary control.tar.gz
cd /
tar xzf data.tar.gz
rm data.tar.gz
touch /var/lib/dpkg/status
touch /var/lib/dpkg/available
touch /var/lib/dpkg/info/dpkg.list
ls /usr/share/doc | grep -v [A-Z] | \
grep -v '^texmf$' | grep -v '^debian$' | \
awk '{print $1 " install"}' | \
dpkg --set-selections
head -2 /var/lib/dpkg/status > temp
cat temp > /var/lib/dpkg/status
rm temp
sed -i 's/not-installed/installed/' /var/lib/dpkg/status
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' /var/lib/dpkg/status
echo 'Version: 1.13.21

' >> /var/lib/dpkg/status

JohnC

unread,
Nov 26, 2008, 2:29:48 PM11/26/08
to pyramidlinux
Has anyone else thought of using ipkg for package management? You can
build custom stripped down packages for the system, which in turn
reduces drive usage. I know that most of the minimalistic alternate
firmwares for other routers use this type of system. I would also make
upgrading pieces simple.

John

On Nov 25, 10:27 pm, "John Otto" <john.sinclair.o...@gmail.com> wrote:
> Hi all,
>
> I noticed someone was asking about apt-get support. I've hacked
> together a script to get dpkg working. It doesn't give the spiffy
> auto-downloading functionality of apt-get, but you can install
> individual .deb packages, and dpkg will check dependencies. I've used
> it to get Java, Bluetooth and ifplugd working.
>
> The script's copied below. Note that this worked for the previous beta
> (pyramid-1.0b5.img.gz), but I haven't tried it with the new release.
> You'll need to get the dpkg .deb file from the Debian package server
> (e.g.http://http.us.debian.org/debian/pool/main/d/dpkg/dpkg_1.13.25_i386.deb).
Reply all
Reply to author
Forward
0 new messages