Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ DEBOOTSTRAP_ARCHIVE=${CACHE_DIR}/debootstrap-cache.tgz
NETKIT_DIR=${BUILD_DIR}/netkit-ng
FS_DIR=${NETKIT_DIR}/fs
MODULES_PATH=../kernel/build/netkit-ng/kernel/modules/lib/uml/modules/
NAMESERVER=$(shell grep nameserver /etc/resolv.conf | cut -d\ -f2 | tail -n 1)

default: ${FINAL_ARCHIVE}

Expand All @@ -26,6 +27,7 @@ init: clean
${FINAL_ARCHIVE}: init ${DEBOOTSTRAP_ARCHIVE} ${MODULES_PATH}
cp -r ${MODULES_PATH} ${BUILD_DIR}
echo "Netkit-NG filesystem version ${NETKIT_FS_RELEASE}" > ${FS_DIR}/netkit-filesystem-version
sed -i "s/^nameserver=\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/nameserver=${NAMESERVER}/" rootstrap.conf
rootstrap ${FS_DIR}/netkit-fs-${SUBARCH}-${NETKIT_FS_RELEASE}
cd ${FS_DIR} ; ln -s netkit-fs-${SUBARCH}-${NETKIT_FS_RELEASE} netkit-fs
mv ${FS_DIR}/netkit-fs-${SUBARCH}-${NETKIT_FS_RELEASE} ${FS_DIR}/netkit-fs-${SUBARCH}-${NETKIT_FS_RELEASE}.old
Expand All @@ -34,6 +36,8 @@ ${FINAL_ARCHIVE}: init ${DEBOOTSTRAP_ARCHIVE} ${MODULES_PATH}
cd ${BUILD_DIR}/ ; tar -cvSjf ../${FINAL_ARCHIVE} netkit-ng/

${DEBOOTSTRAP_ARCHIVE}:
apt-get install debootstrap rootstrap
mkdir -p ${BUILD_DIR}/debootstrap/
mkdir -p ${CACHE_DIR}
debootstrap --make-tarball=${DEBOOTSTRAP_ARCHIVE} wheezy ${BUILD_DIR}/debootstrap/ http://ftp.fr.debian.org/debian

Binary file not shown.
Binary file added fs/custom-deb/openvswitch-ipsec_2.3.1-1_i386.deb
Binary file not shown.
Binary file added fs/custom-deb/openvswitch-switch_2.3.1-1_i386.deb
Binary file not shown.
Binary file added fs/custom-deb/python-openvswitch_2.3.1-1_all.deb
Binary file not shown.
2 changes: 2 additions & 0 deletions fs/disabled-services
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ mrd6
mtab.sh
openbsd-inetd
openvpn
openvswitch-switch
openvswitch-ipsec
pdns-recursor
pipsecd
proftpd
Expand Down
9 changes: 9 additions & 0 deletions fs/modules/netkit
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ if test "$install" = "true"; then
undivert $TARGET/sbin/start-stop-daemon
fi

# install custom deb files
if test "$install" = "true"; then
divert $TARGET/sbin/start-stop-daemon
find $WORKDIR/custom-deb/ -name \*.deb -exec cp '{}' $TARGET/tmp/ \;
chroot $TARGET find /tmp/ -name \*.deb -exec dpkg --install '{}' \;
fuser -k -v -m $TARGET || true
undivert $TARGET/sbin/start-stop-daemon
fi

# copy netkit filesystem files
tar -C $WORKDIR/filesystem-tweaks -c . | tar -C $TARGET -x

Expand Down
4 changes: 3 additions & 1 deletion fs/packages-list
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ nmap
openssh-client
openssh-server
openssl
strongswan
#strongswan
openvpn
openvswitch-switch
openvswitch-ipsec
pdns-recursor
ppp
pppoe
Expand Down
2 changes: 1 addition & 1 deletion fs/rootstrap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ gateway=192.168.10.1
# optional if you are fetching packages through a proxy

#domain=example.com
nameserver=8.8.8.8
nameserver=192.168.80.4

#
# Debian module
Expand Down
20 changes: 19 additions & 1 deletion kernel/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
include ../Makefile.am

KERNEL_VERSION=user-mode-linux-3.2-2um
KERNEL_NUMBER=3.2.51
KERNEL_NUMBER=3.2.65
OVS_BRANCH=2.3

BUILD_DIR=build
NETKIT_DIR=${BUILD_DIR}/netkit-ng
KERNEL_DIR=${NETKIT_DIR}/kernel
DEBIAN_PACKAGE_DIR=${BUILD_DIR}/${KERNEL_VERSION}
WD=$(shell pwd)

default: ../${KERNEL_ARCHIVE_FILE}

Expand All @@ -30,13 +32,29 @@ ${DEBIAN_PACKAGE_DIR}/debian/user-mode-linux/usr/bin/linux.uml: ${DEBIAN_PACKAGE
sed 's/CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION="-netkit-ng-$(NETKIT_KERNEL_RELEASE)"/' config.i386 > ${BUILD_DIR}/${KERNEL_VERSION}/config.${SUBARCH}
cp patches/* ${DEBIAN_PACKAGE_DIR}/debian/patches/
cd ${DEBIAN_PACKAGE_DIR} ; dpkg-buildpackage -rfakeroot -nc -uc
#BEGIN
cd ${BUILD_DIR} ; wget https://github.com/openvswitch/ovs/archive/branch-${OVS_BRANCH}.zip
cd ${BUILD_DIR} ; apt-get install unzip autoconf build-essential libtool
cd ${BUILD_DIR} ; unzip branch-${OVS_BRANCH}.zip
cd ${BUILD_DIR}/ovs-branch-${OVS_BRANCH}; ./boot.sh; ./configure --with-linux=../${KERNEL_VERSION}/linux-source-3.2 KARCH=um;ARCH=um make
#END


../${KERNEL_ARCHIVE_FILE}: ${DEBIAN_PACKAGE_DIR}/debian/user-mode-linux/usr/bin/linux.uml
mkdir -p ${KERNEL_DIR}
cp ${DEBIAN_PACKAGE_DIR}/debian/user-mode-linux/usr/bin/linux.uml ${KERNEL_DIR}/netkit-kernel-${SUBARCH}-${KERNEL_NUMBER}-${NETKIT_KERNEL_RELEASE}
cd ${KERNEL_DIR} ; ln -s netkit-kernel-${SUBARCH}-${KERNEL_NUMBER}-${NETKIT_KERNEL_RELEASE} netkit-kernel
mkdir -p ${KERNEL_DIR}/modules/
cp -r ${DEBIAN_PACKAGE_DIR}/debian/user-mode-linux/usr/lib/ ${KERNEL_DIR}/modules/
#BEGIN
mkdir ${KERNEL_DIR}/modules/lib/uml/modules/${KERNEL_NUMBER}-netkit-ng-${NETKIT_KERNEL_RELEASE}/kernel/net/openvswitch ; cp ${BUILD_DIR}/ovs-branch-${OVS_BRANCH}/datapath/linux/openvswitch.ko ${KERNEL_DIR}/modules/lib/uml/modules/${KERNEL_NUMBER}-netkit-ng-${NETKIT_KERNEL_RELEASE}/kernel/net/openvswitch/openvswitch.ko
ln -s ${WD}/${KERNEL_DIR}/modules/lib/uml/modules ${KERNEL_DIR}/modules/lib/modules
depmod -b ${KERNEL_DIR}/modules ${KERNEL_NUMBER}-netkit-ng-${NETKIT_KERNEL_RELEASE}
#sleep 99999
#END
echo "Netkit-NG kernel version $(NETKIT_KERNEL_RELEASE)" > ${KERNEL_DIR}/netkit-kernel-version
cd ${BUILD_DIR}/ ; tar -cvjf ../../${KERNEL_ARCHIVE_FILE} netkit-ng/

debug :
@echo ${KERNEL_DIR}/modules/lib/uml/modules/kernel-${SUBARCH}-${KERNEL_NUMBER}-${NETKIT_KERNEL_RELEASE}/kernel/net/
@echo "ln -s ${KERNEL_DIR}/modules/lib/uml/modules ${KERNEL_DIR}/modules/lib/modules"