Skip to content
This repository
tree: 31be95a049
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 38 lines (28 sloc) 0.777 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 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

  
Something went wrong with that request. Please try again.