Skip to content

Commit

Permalink
adding the rfs-pacman rootfs update/manipulation utility
Browse files Browse the repository at this point in the history
  • Loading branch information
WarheadsSE committed Aug 5, 2012
1 parent d0c94da commit 2175cfe
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions scripts/rfs-pacman
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# rfs-pacman
# simplified rootfs manipulation with pacman.
##

# current directory
PWD=`pwd`

# does this directory have etc/pacman.conf?
if [ -f $PWD/etc/pacman.conf ]; then

SHORT=`echo $PWD | sed 's/.*\///'`
ARCH=`grep 'Architecture =' etc/pacman.conf | sed 's/Architecture = //'`
echo "Calling pacman:"
echo " -root: $PWD"
echo " -arch: $ARCH"

SEDPWD=`echo $PWD | sed 's/\\//\\\\\//g'`
sed "s/\/etc\/pacman.d/$SEDPWD\/etc\/pacman.d/" \
$PWD/etc/pacman.conf > etc/pacman.conf.rfs

pacman \
-r $PWD \
-b $PWD/var/lib/pacman \
--arch $ARCH \
--cachedir $PWD/var/cache/pacman/pkg \
--config $PWD/etc/pacman.conf.rfs \
--logfile $PWD/../$SHORT.pacman.log \
$@

rm $PWD/etc/pacman.conf.rfs

else
echo "'$PWD' doesn't appear to be a rootfs."
fi


0 comments on commit 2175cfe

Please sign in to comment.