rpms/hercules/devel README.fedora, NONE, 1.1 hercules-run, NONE, 1.1 hercules.cnf, NONE, 1.1 hercules.spec, 1.11, 1.12

Matthias Saou (thias) fedora-extras-commits at redhat.com
Mon Jul 3 17:48:00 UTC 2006


Author: thias

Update of /cvs/extras/rpms/hercules/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17636

Modified Files:
	hercules.spec 
Added Files:
	README.fedora hercules-run hercules.cnf 
Log Message:
Start cleaning up the package so that things work out of the box, and are properly documented.



--- NEW FILE README.fedora ---
These are quick instructions on how to get Fedora Core development for s390
running with Hercules.

Go to ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/s390/os/images/
Download these files :
- generic.prm
- initrd.img
- kernel.img
- tape0
- tape.tdf

Prepare :
=======
- Install : yum install hercules
- Create HD image : dasdinit -z /var/lib/hercules/linux.120 3390-3 lin000
- Copy downloaded files into /etc/hercules/
- Run : hercules-run
- Start installation : ipl 000C

Note that when running Hercules, all commands sent to the OS must be prefixed
by a dot. When not prefixed, commands are sent to Hercules itself (like "ipl").

OS installation :
===============
Which kind of network device do you intend to use:
.ctc
Enter the bus ID and the device number of your CCW devices:
.0.0.0600,0.0.0601
Enter the FQDN of your new Linux guest:
.s390.localdomain
Enter the IP address of your new Linux guest:
.192.168.200.3
Enter the network address of the new Linux guest:
.255.255.255.255
Enter the IP of your CTC / ESCON / IUCV point-to-point partner:
.192.168.200.4
Select which protocol should be used for the CTC interface
.1



--- NEW FILE hercules-run ---
#!/bin/sh

###  Startup script for the Hercules S/390 emulator
###  Copyright (C) 2001 Karsten Hopp <karsten at redhat.de>
###  Copyright (C) 2003 Florian La Roche <laroche at redhat.com>

# This is your "hercules network" between your machine running the
# hercules emulator and the Linux guest running in hercules.
HERCNET="192.168.200.0/24"

PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH
unset LANG LC_COLLATE

if [ `id -u` != 0 ]; then
    echo "This script requires root permissions."
    exit 1
fi

# This device must be present for hercules to setup networking.
[ -d /dev/net ] || mkdir -p /dev/net
[ -c /dev/net/tun ] || mknod /dev/net/tun c 10 200

# Load the necessary kernel modules:
for module in tun ip_tables iptable_filter ip_conntrack_ftp ip_nat_ftp; do
    modprobe ${module} &>/dev/null
done

# Enable IP forwarding
sysctl -w net.ipv4.ip_forward=1 >/dev/null

# Masquerade the hercules network.
iptables -t nat -A POSTROUTING -s ${HERCNET} -j MASQUERADE
iptables -A FORWARD -i eth0 -o tun0 -m state --state ESTABLISHED,RELATED -j ACCEPT

# Start hercules itself.
cd /etc/hercules
hercules



--- NEW FILE hercules.cnf ---
# Sample configuration file to run Red Hat Linux or Fedora Core S/390 with the
# the Hercules ESA/390 emulator

CPUSERIAL 002623        # CPU serial number
CPUMODEL  3090          # CPU model number: 3090, 7490, 2064
MAINSIZE  256           # Main storage size in megabytes
NUMCPU    1             # Number of CPUs
CNSLPORT  3270          # TCP port number to which consoles connect
#HTTPPORT 8081          # enable a HTTP server on this port
OSTAILOR  LINUX         # OS tailoring
LOADPARM  0120....      # IPL parameter
IODELAY   0             # modern kernels do not need a delay
ARCHMODE  ESA/390       # Architecture mode S/370, ESA/390 or ESAME
TZOFFSET  +0100         # Central Europe
MODPATH   @LIBDIR@/hercules
LDMOD     hdt3088.so hdt3420.so hdt3505.so

# .----------------- Device number
# |   .------------- Device type
# |   |    .-------- File name and parameters
# |   |    |
# V   V    V
#---  ---- --------------------
# card reader
000C  3505 kernel.img generic.prm initrd.img autopad
# card punch
#000D 3525 punch00d.txt ascii
# line printer
#000E 1403 print00e.txt crlf
# local non-SNA 3270 TN3270 client connection
#001F 3270
# CKD direct access storage device
# initialize with: dasdinit -z linux.120 3390-3 lin000
0120  3390 /var/lib/hercules/linux.120
# local non-SNA 3270 TN3270 client connection
#0200 3270
#0201 3270
# tape drives
0580  3420 /etc/hercules/tape.tdf
#0581 3420 /dev/st0
#0582 3420 ickdsf.ipl
# networking, channel-to-channel adapter
0600  3088 CTCI -n /dev/net/tun -t 1500 192.168.200.3 192.168.200.4
# networking, LCS adaptor
#0700 3088 LCS 192.168.200.4 -n /dev/net/tun -m 01:02:03:04:05:06



Index: hercules.spec
===================================================================
RCS file: /cvs/extras/rpms/hercules/devel/hercules.spec,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- hercules.spec	3 Jul 2006 10:33:50 -0000	1.11
+++ hercules.spec	3 Jul 2006 17:48:00 -0000	1.12
@@ -1,13 +1,14 @@
-#define date 20041025
-
 Summary: Hercules S/370, ESA/390, and z/Architecture emulator
 Name: hercules
 Version: 3.04.1
-Release: 1%{?date:.%{date}}
+Release: 2%{?dist}
 License: QPL
 Group: Applications/Emulators
 URL: http://www.conmicro.cx/hercules/
-Source: http://www.conmicro.cx/hercules/hercules-%{version}%{?date:-cvs}.tar.gz
+Source0: http://www.conmicro.cx/hercules/hercules-%{version}.tar.gz
+Source1: hercules.cnf
+Source2: hercules-run
+Source3: README.fedora
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: bison, zlib-devel, bzip2-devel
 Obsoletes: hercules-docs <= 3.01
@@ -22,127 +23,11 @@
 
 
 %prep
-%setup -n %{name}-%{version}%{?date:-cvs}
-
-%{__mv} hercules.cnf hercules.cnf.sample
-%{__cat} <<EOF >hercules.cnf
-# Sample configuration file to run Red Hat Linux or Fedora Core S/390 with the
-# the Hercules ESA/390 emulator
-#
-CPUSERIAL 002623        # CPU serial number
-CPUMODEL  3090          # CPU model number: 3090, 7490, 2064
-MAINSIZE  256           # Main storage size in megabytes
-NUMCPU    1             # Number of CPUs
-CNSLPORT  3270          # TCP port number to which consoles connect
-#HTTPPORT 8081          # enable a HTTP server on this port
-OSTAILOR  LINUX         # OS tailoring
-LOADPARM  0120....      # IPL parameter
-IODELAY   0             # modern kernels do not need a delay
-ARCHMODE  ESA/390       # Architecture mode S/370, ESA/390 or ESAME
-TZOFFSET  +0100         # Central Europe
-MODPATH   %{_libdir}/hercules
-
-# .-----------------------Device number
-# |   .-----------------Device type
-# |   |    .---------File name and parameters
-# |   |    |
-# V   V    V
-#---  ---- --------------------
-# card reader
-000C  3505 kernel.img hercules.prm initrd.img autopad
-# card punch
-#000D 3525 punch00d.txt ascii
-# line printer
-#000E 1403 print00e.txt crlf
-# local non-SNA 3270 TN3270 client connection
-#001F 3270
-# CKD direct access storage device
-# initialize with: dasdinit -z linux.120 3390-3 lin000
-0120  3390 %{_sysconfdir}/hercules/linux.120
-# local non-SNA 3270 TN3270 client connection
-#0200 3270
-#0201 3270
-# tape drives
-0580  3420 %{_sysconfdir}/hercules/hercules.tdf
-#0581 3420 /dev/st0
-#0582 3420 ickdsf.ipl
-# networking, channel-to-channel adapter
-0600  3088 CTCI -n /dev/net/tun -t 1500 192.168.200.3 192.168.200.4
-# networking, LCS adaptor
-#0700 3088 LCS 192.168.200.4 -n /dev/net/tun -m 01:02:03:04:05:06
-EOF
-
-%{__cat} <<EOF >hercules.ins
-* Red Hat Linux for S/390 Installation
-kernel.img 0x00000000
-initrd.img 0x00800000
-hercules.prm 0x00010480
-EOF
-
-%{__cat} <<'EOF' >hercules.init
-#!/bin/sh
-
-###  Startup script for the Hercules S/390 emulator
-###  Copyright (C) 2001 Karsten Hopp <karsten at redhat.de>
-###  Copyright (C) 2003 Florian La Roche <laroche at redhat.com>
-
-### This is your "hercules network" between your machine running the
-### hercules emulator and the Linux guest running in hercules.
-HERCNET="192.168.200.0/24"
-
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-export PATH
-unset LANG LC_COLLATE
-
-if [ `id -u` != 0 ]; then
-    echo "This script requires root permissions."
-    exit 1
-fi
-
-lsmod | grep -q ipchains && {
-    echo "ipchains module is already loaded, cannot setup iptables."
-    exit 1
-}
-
-### This device must be present for hercules to setup networking.
-[ -d /dev/net ] || mkdir -p /dev/net
-[ -c /dev/net/tun ] || mknod /dev/net/tun c 10 200
-
-### Load the necessary kernel modules:
-modprobe tun ip_tables iptable_filter ip_conntrack ip_conntrack_ftp ip_nat_ftp 2>/dev/null
-
-### Enable IP forwarding, you can permanently change this in in
-### /etc/sysctl.conf with "net.ipv4.ip_forward = 1".
-echo "1" > /proc/sys/net/ipv4/ip_forward
-
-### Masquerade the hercules network.
-iptables -t nat -A POSTROUTING -s ${HERCNET} -j MASQUERADE
-iptables -A FORWARD -i eth0 -o tun0 -m state --state ESTABLISHED,RELATED -j ACCEPT
-
-### Start hercules itself.
-cd %{_sysconfdir}/hercules
-LD_ASSUME_KERNEL=2.4.1
-export LD_ASSUME_KERNEL
-hercules
-EOF
-
-%{__cat} <<EOF >hercules.prm
-root=/dev/ram0 ro ip=off ramdisk_size=40000
-EOF
-
-%{__cat} <<EOF >hercules.tdf
- at TDF
-tape0 FIXED RECSIZE 1024
-kernel.img FIXED RECSIZE 1024
-hercules.prm FIXED RECSIZE 1024
-initrd.img FIXED RECSIZE 1024
-EOT
-EOF
-
+%setup
 
 %build
-# Get the modules in the right place
-%{__perl} -pi -e 's|(\${DESTPREFIX})/lib/|$1/%{_lib}/|g' configure*
+# Get the modules in the right place (lib64 on 64bit archs)
+%{__perl} -pi -e 's|\${DESTPREFIX}/lib/|${libdir}/|g' configure*
 # Required in 3.04 to find libs on x86_64
 export LDFLAGS="-L%{_libdir}"
 %configure \
@@ -153,33 +38,50 @@
 
 
 %install
-%{__rm} -rf %{buildroot}
+%{__rm} -rf %{buildroot} README.fedora
 %{__make} install DESTDIR=%{buildroot}
 %find_lang %{name}
-%{__mkdir_p} %{buildroot}%{_sysconfdir}/hercules/
-%{__install} -p -m 0755 hercules.init %{buildroot}%{_sysconfdir}/hercules/
-%{__install} -p -m 0644 hercules.cnf hercules.{ins,prm,tdf} \
-    %{buildroot}%{_sysconfdir}/hercules/
+# Install our configuration file, substitute @LIBDIR@ for the current value
+%{__mkdir_p} %{buildroot}%{_sysconfdir}/hercules
+%{__cat} %{SOURCE1} | %{__sed} 's|@LIBDIR@|%{_libdir}|g' > \
+    %{buildroot}%{_sysconfdir}/hercules/hercules.cnf
+# Install our wrapper script (takes care of tunnel networking)
+%{__install} -D -p -m 0755 %{SOURCE2} \
+    %{buildroot}%{_sbindir}/hercules-run
+# Copy our README to be included as doc
+%{__cp} -a %{SOURCE3} README.fedora
+# Create empty directory where to store system images
+%{__mkdir_p} %{buildroot}%{_var}/lib/hercules
 
 
 %clean
 %{__rm} -rf %{buildroot}
 
+
 %files -f %{name}.lang
 %defattr(-, root, root, 0755)
-%doc CHANGES README* RELEASE* hercules.cnf.sample html/ util/
+%doc CHANGES README* RELEASE* hercules.cnf html/ util/
 %dir %{_sysconfdir}/hercules/
-%config(noreplace) %{_sysconfdir}/hercules/*
+%attr(0644, root, root) %config(noreplace) %{_sysconfdir}/hercules/hercules.cnf
 %{_bindir}/*
+%{_sbindir}/*
 %{_datadir}/hercules/
 %{_libdir}/hercules/
 %exclude %{_libdir}/hercules/*.la
 %{_libdir}/*.so
 %exclude %{_libdir}/*.la
 %{_mandir}/man?/*
+%dir %{_var}/lib/hercules/
 
 
 %changelog
+* Mon Jul  3 2006 Matthias Saou <http://freshrpms.net/> 3.04.1-2
+- Move out all the inlined configuration files, keep only the .cnf file.
+- Update .cnf file so that it works (load modules required for the default).
+- Include README.fedora to give quick instructions on how to get started.
+- Include empty %{_var}/lib/hercules/ directory.
+- Rename hercules.init to hercules-run in PATH and clean it up somewhat.
+
 * Mon Jul  3 2006 Matthias Saou <http://freshrpms.net/> 3.04.1-1
 - Update to 3.04.1 (useless, I know).
 - Remove no longer needed libgcrypt dependency.




More information about the fedora-extras-commits mailing list