[Slackbuilds-users] Virtualization and package building

David Woodfall dave at dawoodfall.net
Wed Dec 2 20:04:02 UTC 2015


>On 02/12/15 19:57, David Woodfall wrote:
>>>Hi,
>>>
>>>I have to build packages for Slackware 14.0 and 14.1 as well as the
>>>upcoming 14.2, for both 32-bit and 64-bit architecture and different
>>>scenarios: server vs. desktop.
>>>
>>>Until april 2015 I built everything in a series of VirtualBox guests on
>>>my main workstation, which worked quite well most of the time. I vaguely
>>>remember having had trouble with one or two packages, but don't recall
>>>exactly which one.
>>>
>>>Since this date I've setup a dedicated package build host on a rather
>>>modest hardware (AMD dual core processor, meh), and with a quite
>>>bone-headed setup. No virtualization here, only a good old multiboot
>>>with a hard disk partitioned to death: 15 partitions with a shared swap
>>>and a maximum of 14 different systems, currently 8 in use. I reckon this
>>>is a rather unusual way of doing things, but 1) KISS 2) works perfectly.
>>>
>>>Last week I bought a thick book about Linux & Virtualization, and before
>>>diving head first into all this stuff, I have a general question out of
>>>curiosity. I guess most of you build your stuff in virtual guests
>>>(correct me if I'm wrong). What kind of virtualization do you use for
>>>this? KVM + qemu seems to be great for servers, but is it apt for
>>>setting up a desktop stuff and building graphical applications (Scribus,
>>>VLC, whatever)?
>>>
>>>I think I'll read the book differently if I already have a vague sense
>>>of where I'm heading.
>>>
>>>Cheers,
>>>
>>>Niki
>>
>>I use chroots - a 64bit for pretty much everything, but I also have a
>>32bit chroot for building wine in. It's faster than booting a VM.
>
>Can you write a bit more on how you do this?
>Or give an reference?

I use this 'mkchroot' script, after mounting the Slackware DVD, to
install into the chroot:

##########################################
#!/bin/sh

set -e

SERIES="a ap d f k kde l n t tcl x xap y"
CHPATH="/home/chroots/slackware64"
CDPATH="/mnt/cdrom/slackware64"
bgreen="^[[01;32m"
normal="^[[0m"

cd $CDPATH

for i in $SERIES
do
    echo "${bgreen}Installing series $i${normal}"
    upgradepkg --reinstall --install-new -root $CHPATH $i/*.t?z
done

mkdir -p $CHROOT/proc
mkdir -p $CHROOT/dev
mkdir -p $CHROOT/sys
mkdir -p $CHROOT/tmp
##########################################

I use this script 'cht' to use log in:

##########################################
#!/bin/sh

CHROOT=/home/chroots/slackware64

if [ ! -r "$CHROOT" ]; then
    exit 1
fi

# These are now mounted in /etc/fstab
#mount -o bind /proc $CHROOT/proc
#mount -o bind /dev $CHROOT/dev
#mount -o bind /sys $CHROOT/sys
#mount -o bind /tmp $CHROOT/tmp

cp /etc/resolv.conf $CHROOT/etc
cp /home/david/.Xauthority $CHROOT/root

chroot $CHROOT /bin/zsh
##########################################

My /etc/fstab entries:

/proc  /home/chroots/slackware64/proc auto rw,bind,noatime 0 0
/dev   /home/chroots/slackware64/dev auto rw,bind,noatime 0 0
/sys   /home/chroots/slackware64/sys auto rw,bind,noatime 0 0
/tmp   /home/chroots/slackware64/tmp auto rw,bind,noatime 0 0

/tmp is shared between guest and host so I can move files/packages in
and out easier.

Hope this help.

David
-------------- next part --------------
#!/bin/sh

set -e

SERIES="a ap d f k kde l n t tcl x xap y"
CHPATH="/home/chroots/slackware64"
CDPATH="/mnt/cdrom/slackware64"
bgreen=""
normal=""

cd $CDPATH

for i in $SERIES
do
    echo "${bgreen}Installing series $i${normal}"
    upgradepkg --reinstall --install-new -root $CHPATH $i/*.t?z
done


-------------- next part --------------
#!/bin/sh

CHROOT=/home/chroots/slackware64

if [ ! -r "$CHROOT" ]; then
    exit 1
fi

# These are now mounted in /etc/fstab
#mount -o bind /proc $CHROOT/proc
#mount -o bind /dev $CHROOT/dev
#mount -o bind /sys $CHROOT/sys
#mount -o bind /tmp $CHROOT/tmp

cp /etc/resolv.conf $CHROOT/etc
cp /home/david/.Xauthority $CHROOT/root

chroot $CHROOT /bin/zsh



More information about the SlackBuilds-users mailing list