Editing
Installation on Slackware 14
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Make the guest == Now let's create the guest and install the packages. As you know you must choose at least a "name", a "context" and an ip. In addition you have to modify most of the ''rc.*'' startup scripts removing all the hardware related daemons, and finally replace the ''/dev'' dir. This is done adjusting and running the script ''make_slack_vserver.sh'': <pre> #!/bin/bash # # v. 2016.07.05 # Author: Roberto Puzzanghera # Thanks to Mark Colclough for corrections # # This script installs a Slackware guest into a linux-vserver host (http://linux-vserver.org) # # Comments are welcome :-) # More info here: https://notes.sagredo.eu/other-contents-186/slackware-guest-on-linux-vserver-7.html # adjust this to where your things live NAME=test HOSTNAME=$NAME.YOURDOMAIN.XY IP=10.0.0.182 INTERFACE=eth0:$IP/24 CONTEXT=5182 VERSION=14.2 # Slackware version ARCH="64" # you can put 64 for 64b cpu just to separate 64/32 download folders # where is the vservers dir? default is /vservers VDIR="/usr/local/vservers" # the directory where you unpacked slack_vserver.tar.gz # $PWD should work, otherwise put /path/to/slack_vserver SETUP=$PWD # the directory where you downloaded the slackware packages PACKAGES="${SETUP}/slackware${ARCH}-${VERSION}_pkg" # the path to rc script file (leave as is) RC="${SETUP}/rc" ################### end configuration # sanity check if [ ! -d "$VDIR" ]; then echo echo "Can't find VDIR dir: $VDIR" echo "Exiting" echo exit 1 fi if [ ! -d "$SETUP" ]; then echo echo "Can't find SETUP dir: $SETUP" echo "Exiting" echo exit 1 fi if [ ! -d "$PACKAGES" ]; then echo echo "Can't find PACKAGES dir: $PACKAGES" echo "Exiting" echo exit 1 fi if [ ! -f "$RC" ]; then echo echo "Can't find RC path: $RC" echo "Exiting" echo exit 1 fi # if everything is ok start the install echo read -p "press any key to make skeleton..." vserver ${NAME} build -m skeleton \ --hostname ${HOSTNAME} \ --interface ${INTERFACE} \ --context $CONTEXT \ --flags lock,virt_mem,virt_uptime,virt_cpu,virt_load,sched_hard,hide_netif \ --initstyle sysv echo "...done" echo read -p "press any key to move the /dev folder to a temp dir the /dev folder..." mv $VDIR/$NAME/dev $VDIR/$NAME/dev2 echo read -p "press any key to install packages..." cd $PACKAGES installpkg --root $VDIR/$NAME *.t?z; ROOT=$VDIR/$NAME upgradepkg patches/*.t?z; echo "...done" echo echo read -p "press any key to copy the rc script to /etc/rc.d/init.d..." echo echo "copying rc to /etc/rc.d/init.d/rc" cp -p $RC $VDIR/$NAME/etc/rc.d/init.d/ echo "...done" echo echo "removing x flag to rc.sshd and rc.inetd, removing not needed rc scripts" chmod -x $VDIR/$NAME/etc/rc.d/rc.sshd $VDIR/$NAME/etc/rc.d/rc.inetd rm $VDIR/$NAME/etc/rc.d/rc.cpufreq $VDIR/$NAME/etc/rc.d/rc.modules* $VDIR/$NAME/etc/rc.d/rc.inet1* $VDIR/$NAME/etc/rc.d/rc.loop echo "...done" echo echo "trying to adjust HOSTNAME, hosts, resolv.conf, profile. Check them later..." cp /etc/resolv.conf $VDIR/$NAME/etc/ cp /etc/localtime $VDIR/$NAME/etc/ rm $VDIR/$NAME/etc/profile cp /etc/profile $VDIR/$NAME/etc/ echo $HOSTNAME > $VDIR/$NAME/etc/HOSTNAME echo "127.0.0.1 localhost" > $VDIR/$NAME/etc/hosts echo "$IP $HOSTNAME $NAME" >> $VDIR/$NAME/etc/hosts touch $VDIR/$NAME/etc/mtab touch $VDIR/$NAME/etc/fstab echo "...done" echo read -p "press any key to restore /dev2 to /dev" rm -r $VDIR/$NAME/dev mv $VDIR/$NAME/dev2 $VDIR/$NAME/dev echo echo -n "Do you want that I apply the patch for you y/n? [y] " read VAR_PATCH if [ "$VAR_PATCH" = 'y' ] || [ "$VAR_PATCH" = '' ]; then if [ ! -f "${SETUP}/linux-vserver_slackware-${VERSION}.patch" ]; then echo echo "Can't find any PATCH here: ${SETUP}/linux-vserver_slackware-${VERSION}.patch" echo "Exiting" echo exit 1 fi cd ${VDIR}/${NAME}/etc/rc.d patch -p1 < ${SETUP}/linux-vserver_slackware-${VERSION}.patch echo "patch applyed." echo echo "You can start and enter the virtual server typing: " echo echo "vserver $NAME start" echo "vserver $NAME enter" else echo echo "DON'T FORGET to patch /etc/rc.d as follows: " echo echo "cd $VDIR/$NAME/etc/rc.d" echo "patch -p1 < $SETUP/linux-vserver_slackware-$VERSION.patch" fi echo echo "More info on http://notes.sagredo.eu/node/7" echo </pre>
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information