This repository has been archived by the owner on Apr 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
build_tarball.sh
executable file
·62 lines (51 loc) · 2.16 KB
/
build_tarball.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# This script builds tarballs for a Netkit distro.
# It must be run from inside the Netkit directory.
CURRENT_DIRECTORY=`pwd`
NETKIT_DIRECTORY=`basename $CURRENT_DIRECTORY`
NETKIT_VERSION="2.5"
NETKIT_FILESYSTEM_VERSION="F2.2"
NETKIT_KERNEL_VERSION="K2.2"
echo
if ! `echo $NETKIT_DIRECTORY | grep -q netkit`; then
# Most probably, we are not inside the netkit directory
echo "$0: Warning!"
echo "This script is intended for being run from inside the netkit"
echo "directory. Your current directory does not appear to be a"
read -n 1 -p "netkit directory. Do you want to continue [n]? " CONTINUE
echo
echo
[ -z "$CONTINUE" ] && exit 1
[ $CONTINUE != "y" -a $CONTINUE != "Y" ] && exit 1
fi
pushd ..
echo
echo "Building tarballs for directory $NETKIT_DIRECTORY..."
echo -e "\n\n\n"
read -p "Wanna rebuild Netkit scripts archive? [Y]" -n 1 ANSWER
echo
if [ -z "$ANSWER" ] || [ "$ANSWER" == "y" -o "$ANSWER" == "Y" ]; then
echo "Netkit scripts................"
tar --owner=0 --group=0 -cjvf "netkit-${NETKIT_VERSION}.tar.bz2" --exclude=DONT_PACK --exclude=`basename $0` \
--exclude=fs --exclude=kernel --exclude=awk --exclude=basename --exclude=date --exclude=dirname \
--exclude=find --exclude=fuser --exclude=grep --exclude=head --exclude=id --exclude=kill --exclude=ls \
--exclude=lsof --exclude=ps --exclude=wc --exclude=getopt \
--exclude=netkit_commands.log --exclude=stresslabgen.sh --exclude=build_tarball.sh "${NETKIT_DIRECTORY}/"
echo
fi
read -p "Wanna rebuild Netkit filesystem archive? [Y]" -n 1 ANSWER
echo
if [ -z "$ANSWER" ] || [ "$ANSWER" == "y" -o "$ANSWER" == "Y" ]; then
echo "Netkit filesystem............."
tar --owner=0 --group=0 -cjvf "netkit-filesystem-${NETKIT_FILESYSTEM_VERSION}.tar.bz2" --exclude=DONT_PACK "${NETKIT_DIRECTORY}/fs"
echo
fi
read -p "Wanna rebuild Netkit kernel archive? [Y]" -n 1 ANSWER
echo
if [ -z "$ANSWER" ] || [ "$ANSWER" == "y" -o "$ANSWER" == "Y" ]; then
echo "Netkit kernel................."
tar --owner=0 --group=0 -cjvf "netkit-kernel-${NETKIT_KERNEL_VERSION}.tar.bz2" --exclude=DONT_PACK "${NETKIT_DIRECTORY}/kernel"
echo
fi
echo "Operation completed."
echo