mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
adding the rfs-pacman rootfs update/manipulation utility
This commit is contained in:
parent
d0c94da92b
commit
2175cfe085
1 changed files with 37 additions and 0 deletions
37
scripts/rfs-pacman
Executable file
37
scripts/rfs-pacman
Executable file
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue