Showing posts with label Slackware64. Show all posts
Showing posts with label Slackware64. Show all posts

Friday, August 10, 2012

Use lftp mirror feature to keep track of slackware-current

As Slackware is approaching 14.0 release, I searched for a tool to keep my local copy of slackware-current to be up to date. I downloaded the packages manually with wget's mirror feature before, but it lacks the ability to synchronous my local copy with remote server.

After searched the internet and modified a script, I has the follow script to keep my local copy in sync with official update.
#!/bin/bash    
HOST="slackware.mirrors.tds.net"
VERSION="current"
LSLACKWARE="/home/ftp/slackware-$VERSION"
LSLACKWARE64="/home/ftp/slackware64-$VERSION"

SLACKWARE="/pub/slackware/slackware-$VERSION"
SLACKWARE64="/pub/slackware/slackware64-$VERSION"
COMMON_OPTIONS="mirror --delete \
       --ignore-time \
       --verbose \
       --exclude-glob kernels/ \
       --exclude-glob pasture/ \
       --exclude-glob patches/ \
       --exclude-glob source/"

if [ ! -d $LSLACKWARE ]; then
    mkdir -p $LSLACKWARE
fi

if [ ! -d $LSLACKWARE64 ]; then
    mkdir -p $LSLACKWARE64
fi

lftp -c "set ftp:list-options -a;
set ftp:passive-mode true;
open ftp://$HOST; 
lcd $LSLACKWARE;
cd $SLACKWARE;
$COMMON_OPTIONS"


lftp -c "set ftp:list-options -a;
set ftp:passive-mode true;
open ftp://$HOST; 
lcd $LSLACKWARE64;
cd $SLACKWARE64;
$COMMON_OPTIONS"

Reference: How to use rsync over FTP

PS. Actually, I should use rsync directly to avoid unnecessary data transfer due to inefficient of FTP. I have since changed to use rsync directly. The script is much more simpler:

#!/bin/bash    
HOST="rsync://mirrors1.kernel.org"
SLACKWARE_FTP_HOME="/home/ftp/slackware"
VERSION="14.1"
LSLACKWARE="$SLACKWARE_FTP_HOME/slackware-$VERSION/"
LSLACKWARE64="$SLACKWARE_FTP_HOME/slackware64-$VERSION/"

SLACKWARE="/slackware/slackware-$VERSION/"
SLACKWARE64="/slackware/slackware64-$VERSION/"

RSYNC_OPT="-av --delete-before --exclude kernels/ --exclude source/"

echo "Updating $LSLACKWARE"
rsync $RSYNC_OPT $HOST$SLACKWARE $LSLACKWARE


echo "Updating $LSLACKWARE64"
rsync $RSYNC_OPT $HOST$SLACKWARE64 $LSLACKWARE64

Monday, July 30, 2012

slackpkg does not work properly in 32-bit chroot environment under Slackware64

I am running Slackware64 13.37 as my main platform, since it is a pure 64-bit system, I run a chroot environment for Slackware to run some 32-bit programs.  But slackpkg does not work as expected.  It downloads the new lists, but when I do slackpkg upgrade-all, it does not found any upgrade packages.
After digging a little bit into slackpkg's source, I found that if I do not define the environment variable ARCH for current architecture, it will find the setting with uname -m, which in this chroot environment, it will be X86_64 and it is not the correct one.  Once I found out this, I issue the following command to get it working as expected:
ARCH=i486 slackpkg --upgrade-all