Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
16168bc
[Debirf] Jessie: fix libntfs
npf Mar 10, 2017
5642a97
[addons] drop ssh keys but add script to generate them
npf Apr 2, 2017
5d97d59
[Debirf] prepare import of Pascal's modifs
npf Apr 2, 2017
5dbeb03
[Debirf] [PATCH 01/12] Initial commit
npf Mar 30, 2017
b4e9db4
[Debirf] [PATCH 02/12] Init a vagrantfile for env generation with debirf
npf Mar 30, 2017
4eea55b
[Debirf] Amended [PATCH 03/12] Prepare a debirf project from kadeploy…
npf Mar 30, 2017
4297ef6
[Debirf] Amended [PATCH 04/12] Add deploy ssh keys, update Makefile, …
npf Mar 30, 2017
403369a
[Debirf] [PATCH 05/12] Add documentation
npf Mar 30, 2017
c55c5d6
[Debirf] [PATCH 06/12] Fixes deploy kernel generation
npf Mar 30, 2017
bca730c
[Debirf] [PATCH 07/12] Change resulting name in order to not end like…
npf Mar 30, 2017
03e1278
[Debirf] [PATCH 08/12] Create a deployment script for debirf-wheezy k…
npf Mar 30, 2017
64538ef
[Debirf] [PATCH 09/12] Add bnx2 and bnx2x firmware
npf Mar 30, 2017
7e725c1
[Debirf] [PATCH 10/12] Release 1.0.1
npf Mar 30, 2017
9f75dd1
[Debirf] [PATCH 11/12] Add wheezy backports and upgrade tar to
npf Mar 30, 2017
c5e7d8b
[Debirf] [PATCH 12/12] Release deploy-wheezy-1.0.2-g5k
npf Mar 30, 2017
822b503
[Debirf] move/rename deploy.sh -> deploy-g5k.sh
npf Apr 2, 2017
564902e
[Debirf] Jessie: force Debian version
npf Apr 2, 2017
60827aa
[Debirf] Jessie: sync with Wheezy -> install firmware bnx*
npf Apr 2, 2017
ddacaf3
[deploy-kernel] add info in README: moved to kameleon recipes
npf Nov 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# First generate the deploy ssh key pair before building the addons

kadeploy/addons$ ./generate-deploy-ssh-keys
3 changes: 3 additions & 0 deletions addons/deploy_env_generation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kernel/
.vagrant/
debirf-wheezy/kadeploy-deploy-kernel/.fakeroot-state.debirf-kadeploy-deploy-kernel
31 changes: 31 additions & 0 deletions addons/deploy_env_generation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
This is deprecated: kadeploy3 deploy kernel are now build with kameleon.
See: https://github.com/oar-team/kameleon-recipes/tree/master/kadeploy3_deploy_kernel_from_scratch


# Grid5000 deployment kernel generation

## Create the vagrant virtual machine

$ vagrant up
$ vagrant ssh

## Gerenate kernel

$ sudo su -
$ cd /vagrant/debirf-wheezy
$ make all

Kernel files will be available into `kernel` directory, ready to copy on kadeploy servers into `/var/lib/tftpboot/kernels`

## Release a new version

Edit the file `debirf-wheezy/version` before generation.
Commit changes and :

$ git add debirf-wheezy/version
$ git commit -m "Release debirf-wheezy 1.0.1"
$ git tags debirf-wheezy-1.0.1
$ git push
$ git push tags


11 changes: 11 additions & 0 deletions addons/deploy_env_generation/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "irisa_debian-8.0"
config.vm.box_url = "https://vagrant.irisa.fr/boxes/irisa_debian-8.0.box"
config.vm.provision "shell", path: "script.sh"
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ DEBIRF_LABEL="debirf-kadeploy-deploy-kernel"
# What suite should be used? On Ubuntu systems the default it
# "karmic", otherwise the default is "squeeze".
#
#DEBIRF_SUITE=
DEBIRF_SUITE="jessie"

# The default distro (eg. "debian" or "ubuntu") is based on the distro
# of the suite specified. If you want to use a suite from a
# non-Debian/Ubuntu distro, specify the distro explicitly here (all
# lowercase).
#
#DEBIRF_DISTRO=
DEBIRF_DISTRO="debian"

# What mirror should debirf pull the suite from? By default, this is
# based on the DEBIRF_DISTRO
Expand All @@ -44,6 +44,6 @@ DEBIRF_MIRROR="http://ftp.fr.debian.org/debian"
#
#export http_proxy=

export INCLUDE=$INCLUDE,taktuk,openssh-client,openssh-server,kexec-tools,tar,bzip2,xz-utils,grub-pc,hdparm,parted,ntpdate,ctorrent,ash,isc-dhcp-client,dosfstools,fsarchiver,ruby,systemd,systemd-sysv,ruby-net-ssh,ruby-net-ssh-multi,ruby-daemons,libntfs10,aufs-tools
export INCLUDE=$INCLUDE,taktuk,openssh-client,openssh-server,kexec-tools,tar,bzip2,xz-utils,grub-pc,hdparm,parted,ntpdate,ctorrent,ash,isc-dhcp-client,dosfstools,fsarchiver,ruby,systemd,systemd-sysv,ruby-net-ssh,ruby-net-ssh-multi,ruby-daemons,ntfs-3g,aufs-tools

export EXCLUDE=$EXCLUDE,vim-common,vim-tiny,laptop-detect,wget,network-manager,dhcpcd,sysvinit
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ debirf_exec ln -s "/lib/systemd/system/rc-local.service" "/etc/systemd/system/rc

mkdir -p $DEBIRF_ROOT/root/.ssh
cat $DEBIRF_BUILDD/kadeploy_specific/ssh/*.pub >> $DEBIRF_ROOT/root/.ssh/authorized_keys

debirf_exec apt-get -y install firmware-bnx2 firmware-bnx2x
20 changes: 20 additions & 0 deletions addons/deploy_env_generation/debirf-wheezy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MODULES_DIR:=/usr/share/debirf/modules/
MODULES:=a0_add_extra_repos a0_motd network serial-terminal z1_clean-root a0_prep-root z0_remove-locales
MAKEFILE_PATH:=$(shell pwd)
VERSION:=$(shell cat ${MAKEFILE_PATH}/version)

all: modlinks build copy

modlinks:
cp -R kadeploy-deploy-kernel /tmp
@$(foreach module,$(MODULES), ln -sf $(MODULES_DIR)$(module) /tmp/kadeploy-deploy-kernel/modules;)

build:
debirf make -r /tmp/kadeploy-deploy-kernel

clean:
(cd /tmp/kadeploy-deploy-kernel ; find -maxdepth 1 -mindepth 1 ! -iname 'kadeploy_specific' ! -iname 'modules' ! -iname 'debirf.conf' -exec rm -rf '{}' \+)

copy:
mv /tmp/kadeploy-deploy-kernel/debirf-kadeploy-deploy-kernel_wheezy_3.2.0-4-amd64.cgz /vagrant/kernel/deploy-wheezy-initrd-$(VERSION)-g5k
mv /tmp/kadeploy-deploy-kernel/vmlinuz-3.2.0-4-amd64 /vagrant/kernel/deploy-wheezy-vmlinuz-$(VERSION)-g5k
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ DEBIRF_LABEL="debirf-kadeploy-deploy-kernel"
# What suite should be used? On Ubuntu systems the default it
# "karmic", otherwise the default is "squeeze".
#
#DEBIRF_SUITE=
DEBIRF_SUITE="wheezy"

# The default distro (eg. "debian" or "ubuntu") is based on the distro
# of the suite specified. If you want to use a suite from a
# non-Debian/Ubuntu distro, specify the distro explicitly here (all
# lowercase).
#
#DEBIRF_DISTRO=
DEBIRF_DISTRO="debian"

# What mirror should debirf pull the suite from? By default, this is
# based on the DEBIRF_DISTRO
Expand All @@ -44,6 +44,6 @@ DEBIRF_MIRROR="http://ftp.fr.debian.org/debian"
#
#export http_proxy=

export INCLUDE=$INCLUDE,taktuk,openssh-client,openssh-server,kexec-tools,tar,bzip2,xz-utils,grub-pc,hdparm,parted,ntpdate,ctorrent,ash,isc-dhcp-client,dosfstools,ufsutils,ntfsprogs,fsarchiver,ruby,libnet-ssh2-ruby,libnet-ssh-multi-ruby,libdaemons-ruby
export INCLUDE=$INCLUDE,taktuk,openssh-client,openssh-server,kexec-tools,tar,bzip2,xz-utils,grub-pc,hdparm,parted,ntpdate,ctorrent,ash,isc-dhcp-client,dosfstools,ufsutils,ntfsprogs,fsarchiver,ruby,libnet-ssh2-ruby,libnet-ssh-multi-ruby,libdaemons-ruby,lvm2,btrfs-tools,xfsprogs

export EXCLUDE=$EXCLUDE,vim-common,vim-tiny,laptop-detect,wget,network-manager,dhcpcd
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -e

# debirf module: add_backports
#

mkdir -p "${DEBIRF_ROOT}/etc/apt/sources.list.d"

case "${DEBIRF_DISTRO}" in
debian)
cat <<EOF > "${DEBIRF_ROOT}/etc/apt/sources.list.d/backports.list"
deb ${DEBIRF_MIRROR} ${DEBIRF_SUITE}-backports main
EOF
;;
esac

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash -e

# debirf module: install-kernel
# install a kernel package, indicated by the expected environment
# variables:
# DEBIRF_PATH
# DEBIRF_ROOT
# DEBIRF_KERNEL_PACKAGE
# DEBIRF_KERNEL_FLAVOR
#
# *** REQUIRED MODULE ***
# WARNING: this module is necessary for proper functioning of debirf.
#
# The debirf scripts were written by
# Jameson Rollins <jrollins@fifthhorseman.net>
# and
# Daniel Kahn Gillmor <dkg@fifthhorseman.net>.
#
# They are Copyright 2007, and are all released under the GPL,
# version 3 or later.

# clear out old modules if they exist, to avoid confusion
rm -rf "$DEBIRF_ROOT/lib/modules"

# download/copy in kernel package
if [ -z "$DEBIRF_KERNEL_PACKAGE" ] ; then
# determine kernel to install. assume arch of build host.

# determine kernel arch. need everything after the kernel version
# and debian version
KARCH=${DEBIRF_KERNEL_FLAVOR:-$(uname -r | cut -d- -f3-)}

# determine the full kernel version from the dependency of the
# generic linux-image-ARCH package in the debirf root (since it
# may be different than what is installed on the build host)
KNAME=$(debirf_exec apt-cache show linux-image-"$KARCH" | grep '^Depends: ' | sed 's/^Depends: //' | tr ',' '\n' | tr -d ' ' | grep ^linux-image | sort -r | head -n1)

# download only the desired kernel package for later dpkg
# extraction. this also downloads the kernel dependencies, but
# they will not be installed, and the downloaded packages will all
# be purged in the end by the clean-root module. it would be nice
# to just use "apt-get download", but that's only supported since
# wheezy.
debirf_exec apt-get install -d -y "$KNAME"

else
# install kernel deb if given at command line
cp "$DEBIRF_KERNEL_PACKAGE" "$DEBIRF_ROOT"/var/cache/apt/archives/
fi

KPKG=$(basename "$DEBIRF_ROOT"/var/cache/apt/archives/linux-image-*)

echo "extracting kernel package $KPKG..."
debirf_exec dpkg --extract /var/cache/apt/archives/"$KPKG" /

# install the module init tools, since they are needed for depmod
debirf_exec apt-get --assume-yes install module-init-tools

cp $DEBIRF_BUILDD/kadeploy_specific/megaraid_sas-06.806.08.00-1_Debian7.0.amd64.deb $DEBIRF_ROOT/root
debirf_exec dpkg -i /root/megaraid_sas-06.806.08.00-1_Debian7.0.amd64.deb

# depmod to create module list
KVERS=$(ls -1 -t "$DEBIRF_ROOT/lib/modules" | head -n1)
echo "generating modules.dep..."
debirf_exec depmod -a "$KVERS"

# extract kernel and debian stock initrd from the build root:
mv "$DEBIRF_ROOT"/boot/vmlinu* "$DEBIRF_BUILDD"

# remove kernel symlinks
if [ -L "$DEBIRF_ROOT"/vmlinuz ] ; then
rm "$DEBIRF_BUILDD"/vmlinuz
fi

Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ EOF

mkdir -p $DEBIRF_ROOT/root/.ssh
cat $DEBIRF_BUILDD/kadeploy_specific/ssh/*.pub >> $DEBIRF_ROOT/root/.ssh/authorized_keys

debirf_exec apt-get -y install firmware-bnx2 firmware-bnx2x
debirf_exec apt-get -y -t wheezy-backports install tar
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@

cd $DEBIRF_ROOT/usr/share
find -maxdepth 1 -mindepth 1 -type d ! -iname 'perl*' ! -iname 'locale' -exec rm -rf '{}' \+

1 change: 1 addition & 0 deletions addons/deploy_env_generation/debirf-wheezy/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.2
13 changes: 0 additions & 13 deletions addons/deploy_env_generation/debirf/Makefile

This file was deleted.

39 changes: 39 additions & 0 deletions addons/deploy_env_generation/g5k-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

SITES="rennes nantes lille nancy luxembourg lyon grenoble sophia"

if [ ! $# -eq 1 2; then
echo "USAGE: $0 [debirf dir] [version]"
exit 1
fi

DEBIRF_DIR=$1
DEBIAN_VERSION=${DEBIRF_DIR#debirf-}
VERSION=$2


kernel_parts="deploy-$DEBIAN_VERSION-initrd deploy-$DEBIAN_VERSION-vmlinuz"
for kernel_part in $kernel_parts; do
file=$DEBIRF_DIR/kernel/$kernel_part-$VERSION-g5k
if [ ! -f $file ]; then
echo "$file does not exists !"
exit 1
fi
done

for site in $SITES; do
echo "--> deploying on site $site..."
server=kadeploy.$site.grid5000.fr
for kernel_part in $kernel_parts; do
file=$kernel_part-$1-g5k
scp $DEBIRF_DIR/kernel/$file $server:/tmp
echo " * move $file into /var/lib/tftpboot/kernels"
ssh $server sudo mv /tmp/$file /var/lib/tftpboot/kernels
echo " * change owner on $file"
ssh $server sudo chown root.deploy /var/lib/tftpboot/kernels/$file
echo " * change mode to 755 on $file"
ssh $server sudo chmod 755 /var/lib/tftpboot/kernels/$file
done
done


5 changes: 5 additions & 0 deletions addons/deploy_env_generation/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

apt-get update
apt-get -y install debirf

6 changes: 6 additions & 0 deletions addons/generate-deploy-ssh-keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -e
# Generate the ssh keys to be used by addons

mkdir -p ssh
cd ssh
ssh-keygen -f id_deploy -N ""
2 changes: 2 additions & 0 deletions addons/ssh/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id_deploy
id_deploy.pub
27 changes: 0 additions & 27 deletions addons/ssh/id_deploy

This file was deleted.

1 change: 0 additions & 1 deletion addons/ssh/id_deploy.pub

This file was deleted.