LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Running Slackware64-current on AWS cloud (http://www.linuxquestions.org/questions/slackware-14/running-slackware64-current-on-aws-cloud-4175423435/)

Skaperen 08-22-2012 10:30 AM

Running Slackware64-current on AWS cloud
 
To get Slackware64-current running on AWS cloud I did the following (roughly described):

1. Installed Slackware in my own VM to create an image (sets A, AP, D, E, F, K, L, N, skipped LILO, selected DHCP, set root password).
2. Extracted the file tree from the image.
3. On AWS started an Ubuntu 12.04 instance (handy source of files mentioned below).
4. On local changed /etc/fstab ... sda1 -> xvda1
5. Copied /boot/grub stuff from cloud version of Ubuntu
6. Copied kernel and stuff from /boot of Ubuntu
7. Edited /boot/grub/grub.cfg to say Slackware instead of Ubuntu (but this didn't matter)
7. On AWS created an empty 8GB EBS volume
8. Attached volume to instance as /dev/sdf
9. On instance noted volume attached as /dev/xvdf
10. Formatted /dev/xvdf with ext4 and same options as /dev/xvda1 (see list in "tune2fs -l /dev/xvda1")
11. Mounted /dev/xvdf as /mnt/xvdf (with "-o rw,noatime")
12. Uploaded the extracted/modified tree from above to the instance loading /mnt/xvdf (I used rsync).
13. Waited around while the 4GB uploaded.
14. On AWS instance unmount /mnt/xvdf
15. On AWS console detached volume
16. Made snapshot of volume
17. Made AMI of volume using a PVGRUB kernel. Visit page http://docs.amazonwebservices.com/AW...edkernels.html to select an "hd0" (not "hd00") kernel AKI id for your preferred AWS region.
18. Launched the AMI into an instance.
19. Waited a few minutes then checked instance system log to be sure it came up.
20. Logged in via SSH (be sure your security groups setting allows you on port 22).

It's rough, but it's a go. More tweaks to smooth it out before I make an AMI public. I'll need to add some "cloud init" stuff to do run time config tweaks such as adding in the AWS configured public keys, and such.

Habitual 08-23-2012 09:50 AM

As a Grid Computing Systems Admin, this post caught my eye, as did this one...

Not too sure about the "Linux - Cloud" designation...but I'd participate there. :)
"Linux - Cloud Technologies" perhaps?

Good work and Thanks for the recipe!

JJ of c9

Edit "roughly described" recipe. A working AMI is a good thing.

NyteOwl 08-23-2012 01:04 PM

Interesting exercise. Thanks for the blow by blow!

geeth4sg 06-25-2013 04:12 AM

slackware 14 with 64 bit
 
hey,

Can you send me the steps that you've configured the slackware 14 on amazon

Alien Bob 06-25-2013 05:43 AM

Hi Skaperen

Would you be interested to write your exercise as a page here? http://docs.slackware.com/howtos:cloud:start
Initially, Darren Austin was going to write that page but I do not think (six months later) that he is ever going to deliver.

Thanks, Eric

AlvaroG 06-25-2013 09:54 AM

At the time when the OP was written, there was no Slackware AMI available. There is one now (search for slackware14), in the Ireland region IIRC.
Of course this doesn't mean that I don't want to read how to build my own if the need arises :)

kite 06-25-2013 12:18 PM

Quote:

Originally Posted by AlvaroG (Post 4978330)
At the time when the OP was written, there was no Slackware AMI available. There is one now (search for slackware14), in the Ireland region IIRC.
Of course this doesn't mean that I don't want to read how to build my own if the need arises :)

I think it is still not quite ready. Last time I tested it, no kernel modules were loaded.

AlvaroG 06-25-2013 01:22 PM

That is still the case, at least with the image I took around a month ago.

geeth4sg 06-26-2013 12:48 AM

Slackware 14
 
#dd if=/dev/zero of=slack14.img bs=1M count=10012

#mke2fs –F –j slack14.img

#mkdir /mnt/slack.cd
#mkdir /mnt/slack

#mount –o loop slack14.img /mnt/slack
#mount –o loop /mnt/cdrom/slackware14.iso /mnt/slack.cd

Creating the Manifest.yaml file with desired packages
#ruby s12-install.rb –m manifest.yaml –v /mnt/slack –r /mnt/slack.cd/slackware

#chroot /mnt/slack

#mkdir -p /boot/grub

vi menu.lst

default 0
timeout 3
title kernel-2.6.34
root (hd0)
kernel /boot/vmlinuz root=/dev/xvda1 xencons=xvda1 console=xvda1 ro

Create vi /etc/fstab and add the following entries to it:

/dev/xvda1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0


Download the instance key script:-

mkdir /var/initialization/

Create the rc.initializtion file
vi /etc/rc.d/rc.initializtion

#!/bin/sh
start_ec2 ()
{
cd /var/initialization/
wget http://169.254.169.254/1.0/meta-data.../0/openssh-key
cp openssh-key /root/.ssh/authorized_keys
mv openssh-key /root/.ssh/system.pub
wget http://169.254.169.254/latest/user-data
cd /root
}
case "$1" in
'start')
start_ec2
;;
esac

#chmod 777 rc.initializtion

Change the file /etc/ssh/ssh_conf

StrictHostKeyChecking no

/etc/ssh/sshd_conf
PasswordAuthentication no

# ec2-bundle-vol -p x86_64_slackware14 -d </root/bundle> -v </mnt/slack> -u <EC2_user_id> -c <user_certificate_file> -k < user_private_key_file > aki-427d952b -r x86_64 --no-inherit


#ec2-upload-bundle -b slack14_sg -m /root/sg/x86_64_slack14.manifest.xml -a <accesskey>-s <secretkey>



#ec2-register slack14_sg/x86_64_slack14.manifest.xml


#ec2-run-instances ami-cdfc13a4 -z us-east-1d -k < user_private_key_file > -t m1.small


The steps that involved of creating image of Slackware 14. Let me know anything I missed out.let me know any modules were loaded.

Regards,
SG

kikinovak 06-26-2013 02:29 AM

A little HOWTO on installing Slackware on a "Dedibox", a very cheap root server in France (for around 15 euros a month) with full root access:

http://www.microlinux.fr/slackware/L...ibox-HOWTO.txt

I've also published this as an article for the french print magazine "Plante Linux". It's in this month's issue.

piacentini 06-26-2013 03:51 PM

Quote:

Originally Posted by geeth4sg (Post 4978769)
Creating the Manifest.yaml file with desired packages
#ruby s12-install.rb m manifest.yaml v /mnt/slack r /mnt/slack.cd/slackware

IIUC, this is a ruby script that installs Slackware using a manifest.yaml file, right? Where is it available?

geeth4sg 06-27-2013 12:15 AM

Kindly find the manifest.yml file. we could include more packages if needs.,


packages:
- 'a/aaa_base-13.1-x86_64-2.txz'
- 'a/aaa_elflibs-13.1-x86_64-1.txz'
- 'a/aaa_terminfo-5.7-noarch-1.txz'
- 'l/apr-1.3.9-x86_64-1.txz'
- 'l/apr-util-1.3.9-x86_64-2.txz'
- 'd/binutils-2.20.51.0.8-x86_64-1.txz'
- 'd/automake-1.11.1-noarch-1.txz'
- 'a/bash-4.1.007-x86_64-1.txz'
- 'a/bin-11.1-x86_64-1.txz'
- 'n/bind-9.4.3_P4-x86_64-1.txz'
- 'd/binutils-2.20.51.0.8-x86_64-1.txz'
- 'a/bzip2-1.0.5-x86_64-1.txz'
- 'a/coreutils-8.5-x86_64-3.txz'
- 'n/curl-7.20.1-x86_64-1.txz'
- 'a/cxxlibs-6.0.13-x86_64-2.txz'
- 'n/cyrus-sasl-2.1.23-x86_64-1.txz'
- 'a/dcron-4.4-i486-1.txz'
- 'a/devs-2.3.1-noarch-25.txz'
- 'n/dhcpcd-5.2.2-i486-1.txz'
- 'ap/diffutils-3.0-x86_64-1.txz'
- 'a/e2fsprogs-1.41.11-x86_64-1.txz'
- 'a/etc-13.013-x86_64-1.txz'
- 'n/ethtool-2.6.33-x86_64-1.txz'
- 'a/findutils-4.4.2-i486-1.txz'
- 'a/gawk-3.1.8-x86_64-1.txz'


settings:
hostname: gittest
domainname: gittest.com
net:
eth0:
dhcp: true


Regards
SG

geeth4sg 06-27-2013 12:35 AM

Hi,

I wants to create the own kernel package of Slackware with Xen support.

Please find my slackbuild below.. but here modules are not build with the package.



"Processor type and features" -> "High Memory Support" -> Make sure it is set to 64GB
•"Processor type and features" -> "PAE (Physical Address Extension) Support" -> enable
•"Processor type and features" -> "Paravirtualized guest support" -> enable
•"Processor type and features" -> "Paravirtualized guest support" -> "Xen guest support" -> enable
•"Device Drivers" -> "Block devices" -> "Xen virtual block device support" -> enable either as a module or built in
•"Device Drivers" -> "Network device support" -> "Xen network device frontend driver" -> enable either as a module or built in

Slackbuild

#!/bin/sh
CWD=`pwd`
TMP=${TMP:-/tmp}
PKG=$TMP/package-kernel-modules

VERSION=${VERSION:-2.6.33.4}
ARCH=${ARCH:-i686}
BUILD=${BUILD:-1}

if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
rm -rf $PKG
mkdir -p $PKG
echo "Using /lib/modules/${VERSION}/"
echo "Make sure these are *ready*... compressed, or not."
echo "However you want 'em."
sleep 5
mkdir -p $PKG/lib/modules
cp -a /lib/modules/${VERSION} $PKG/lib/modules
mkdir -p $PKG/etc/rc.d
cat $CWD/rc.modules.new > $PKG/etc/rc.d/rc.modules-${VERSION}.new
chmod 755 $PKG/etc/rc.d/rc.modules-${VERSION}.new
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Write out the doinst.sh:
cat << EOF > $PKG/install/doinst.sh
config() {
NEW="\$1"
OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r \$OLD ]; then
mv \$NEW \$OLD
elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy
rm \$NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/rc.d/rc.modules-${VERSION}.new

# If rc.modules is a real file, back it up:
if [ -r etc/rc.d/rc.modules -a ! -L etc/rc.d/rc.modules ]; then
cp -a etc/rc.d/rc.modules etc/rc.d/rc.modules.bak
fi
## Now that -smp is default, we probably shouldn't be so paranoid about
## preserving existing symlinks as it causes a full install to point to
## the wrong rc.modules script. If you want your rc.modules to endure,
## copy it to rc.modules.local.
## Make rc.modules a symlink if it's not already, but do not replace
## an existing symlink. You'll have to decide to point at a new version
## of this script on your own...
#if [ ! -L etc/rc.d/rc.modules ]; then
# ( cd etc/rc.d ; rm -rf rc.modules )
# ( cd etc/rc.d ; ln -sf rc.modules-${VERSION} rc.modules )
#fi

# A good idea whenever kernel modules are added or changed:
if [ -x sbin/depmod ]; then
chroot . /sbin/depmod -a ${VERSION} 1> /dev/null 2> /dev/null
fi

EOF

cd $PKG
makepkg -l y -c n $TMP/kernel-modules-${VERSION}-$ARCH-$BUILD.txz

geeth4sg 07-03-2013 03:46 AM

kernel stuff slackware 14 64 bit
 
Hi Skaperen,

let me know Ubuntu Kernel Stuff?

I've problem with booting slackware 14 64 bit..


regards,
sg

AlvaroG 09-02-2013 11:46 PM

Quote:

Originally Posted by AlvaroG (Post 4978471)
That is still the case, at least with the image I took around a month ago.

Well, I went back to this issue, mainly because I wanted to use iptables. After many attempts and short-lived instances, I was able to find the right tweaks and boot the Slackware kernel included in this image.

1. Edit /boot/grub/menu.lst. Change reference from /dev/sda1 to /dev/xvda1. Optionally, add "3" at the end of the command line, since the default runlevel is 4 and we don't need a graphical login here.
2. Edit /etc/fstab. Change root partition to /dev/xvda1
3. Add module ext3 to the initrd (the included initrd has ext4 only, and the FS is ext3)
4. Boot with hd00 kernel (since the volume has a partition table)

That's it, no extra steps. The only problem is that, due to the change in the fstab file, booting with a non-pvgrub kernel is not possible, unless further changes are made (I read something about a patch for Xen to make it devices appear as sd*, I'm not sure if that is actually required or any other hack can be used)


All times are GMT -5. The time now is 04:02 AM.