Differences between revisions 31 and 32
Revision 31 as of 2015-01-25 14:18:06
Size: 10404
Comment: fixup networking; document steps a bit better
Revision 32 as of 2015-07-22 17:05:15
Size: 10517
Editor: ?Eduard Bloch
Comment:
Deletions are marked like this. Additions are marked like this.
Line 77: Line 77:
You might need to re-login or simply modify the permissions of /dev/net/tun if you don't care about security.

Translation(s): none


Aranym is a virtual Atari machine which is useful for M68k Porting. This is a one page installation intended to get Debian/m68k sid running quickly. The disk image is fairly minimal, but can be extended easily.

Contact: <debian-68k@lists.debian.org>

Download Files

Download the January 2015 base image tarball.

The following instructions are for this (January 2015) image, but the April 2012 image is close enough. Follow the Aranym/Quick.bak instructions for the older image.

  • Check the signature and hashes in the README

  • Extract the tarball: tar xvf Ara2015A-ARAnyM.tar.xz

  • Change into the target directory: cd Ara2015A-ARAnyM

  • Symlink a suitable kernel and initrd, for example those shipped in the tarball: ln -s vmlinuz-3.16.0-4-m68k vmlinuz; ln -s initrd.img-3.16.0-4-m68k initrd.img

  • Look at the README.txt file ☺

  • Uncompress the hard disk image (this will create a 16 GiB sparse file with about 370 MiB used): xz -d disk.ima.xz

The hard disk image

… contains an ext4fs at offset 2048 sectors (1 MiB), which – according to atari-fdisk – ends at block (sector) {tbd}. The rest is swap. It’s fairly big, but in theory, shrinking it and then transferring it to a disk to be used in an Amiga, mac68k or other Debian/m68k system should be possible. (But you don’t need that, we have images for that.)

The packages contained therein stem from a debootstrap with --variant=minbase plus a few others, such as a sensible shell (mksh) and editor (ed and jupp) and Desktop Environment (mc), but several others from the default set (and any development tools) are missing. Use dselect to add them from a list. The /etc/apt/apt.conf file is set up to not install Recommends automatically. Also, see the README.txt file included with the image.

  • ed: exit with Q (uppercase) + Enter

  • jupp: help with Ctrl-J, exit with Ctrl-K + q

  • mcedit: exit with Esc + 0

All packages, except one, are standard Debian packages. If you want to keep things strictly Debian, purge wtf-debian-keyring and remove all nōn-Debian/Debian-Ports entries from /etc/apt/sources.list.

Install Aranym

aranym recommends bridge-utils and uml-utilities. The latter is required for networking, so we force its installation. Older versions also recommended ipmasq which may cause you networking grief if you aren't aware, so don't install that.

sudo apt-get --purge install aranym uml-utilities

Configure Networking

Make sure tun is available and setup correctly.

The disk image is setup for point-to-point networking. On your host add the following to /etc/network/interfaces:

auto tap4
iface tap4 inet static
        address 192.168.10.5
        pointopoint 192.168.10.6
        netmask 255.255.255.255
        tunctl_user tglase
        up iptables -t nat -A POSTROUTING -s 192.168.10.6 -j MASQUERADE
        up echo 1 > /proc/sys/net/ipv4/ip_forward
        down iptables -t nat -D POSTROUTING -s 192.168.10.6 -j MASQUERADE

This assumes tap4 is a free tun interface on your system, and tglase is your username (so you can access it as nōn-root). Now start up the interface with: sudo ifup tap4

To get tun/tap networking working, your user must also be in the uml-net group:

$ sudo adduser tglase uml-net

You might need to re-login or simply modify the permissions of /dev/net/tun if you don't care about security.

If you use more than one ARAnyM instance, you will need separate tap interfaces for each instance, which needs changing in three places: aranym.cfg (both Tunnel – to the tap interface used – and Mac – to keep unique), /etc/network/interfaces and, in the guest, also /etc/network/interfaces – do make sure that the address and pointopoint of host and guest are swapped, and that the up and down commands on the host match the guest’s IP.

You will also need to configure the guest if you have only one instance, but the 192.168.10.4/30 IP range is already in use by you.

Start Aranym

aranym is an SDL application, so you need X11 or something like Aranym/Headless. The configuration file specifies the amount of RAM ARAnyM gets (see FastRAM). It’s currently set at 768 MiB, adjust to taste. ARAnyM will happily drive a single cpu core on the host to 100%, but usually isn’t that demanding.

I generally put this into a file ./run.sh in the directory with the image.

cd "$(dirname "$0")"
# avoid it hogging the sound card
SDL_AUDIODRIVER=dummy; export SDL_AUDIODRIVER
# run ARAnyM on CPU core #0 (only)
taskset 0x01 aranym-mmu -l -c aranym.cfg

Read the taskset manual page for details. Basically, use 0x01 shifted left by the number of the CPU core (starting with 0) you want it to use (i.e. 0x02 for the second CPU core, 0x04 for the third, etc). (Or just skip taskset and run aranym-mmu directly.)

When doing this over VNC, do be sure to not move the mouse until the login prompt arrives and you have typed a letter, otherwise the keyboard will not be usable. Actually, scrap that. Over VNC, the keyboard will normally not be usable. There is no serial port support on the Atari, and nfcon is only for output, so you will have to do the initial setup (hostname, root password, add some entropy, install sshd) on a local X11 session (X11 forwarding is even more unusable). Then you can run it headlessly and access it over SSH.

First Steps

See the README.txt file included, too.

  • Log in with user root, password root.

  • Set the hostname (as in README.txt).

  • Type a bit, to generate entropy, or get some from the network, for example using one of these (unfortunately, you need to add --no-check-certificate as ca-certificates is not installed yet):

    • wget -O - --no-check-certificate https://www.fourmilab.ch/cgi-bin/Hotbits?nbytes=64\&fmt=bin | dd of=/dev/urandom

    • wget -O - --no-check-certificate https://www.random.org/cgi-bin/randbyte?nbytes=64\&format=f | dd of=/dev/urandom

    • wget -O - --no-check-certificate https://www.mirbsd.org/lb.cgi?from=m68k,host=$(hostname),seed=$RANDOM$(dd if=/dev/urandom bs=8 count=1 2>/dev/null | hexdump -ve '1/1 "%02X"') | dd of=/dev/urandom

  • Change the root password (do this with a bit of entropy, for the md5crypt salt): passwd root

  • Run dpkg -a --configure (so popularity-contest gets set up, which needs entropy to generate a unique host ID)

  • Optionally, adjust /etc/apt/sources.list (possibly run dpkg --purge wtf-debian-keyring)

  • Run dselect update (or apt-get update)

  • Optionally, run dselect to interactively add standard packages

  • Install other packages, e.g: apt-get install openssh-server sendmail – installing openssh-server also requires entropy, so the above steps are definitely not overkill…

  • Maybe set up a user with sudo access rights? (Install adduser and sudo, run adduser --help, add the user to the sudo group, etc.)

To compile packages, the best would be to install cowbuilder and set it up, similarily to what was described in M68k/Cowbuilder:

  • apt-get install adduser cowbuilder debootstrap eatmydata

  • addgroup --system --gid 1234 pbuilder

  • adduser --system --no-create-home --uid 1234 --gecos pbuilder --disabled-login pbuilder

  • Change /etc/pbuilderrc

  • Either download a base.cow or make your own (needs wtf-debian-keyring still installed): cowbuilder --create --mirror http://www.freewrt.org/~tg/debs68k/ --distribution sid --debootstrapopts --variant=buildd --debootstrapopts --include=wtf-debian-keyring,debian-ports-archive-keyring,eatmydata,fakeroot --debootstrapopts --keyring=/usr/share/keyrings/wtf-debian-keyring.gpg

  • Go to /var/cache/pbuilder/base.cow and configure a number of files, as described in M68k/Cowbuilder:

    • etc/apt/sources.list should contain only two or three lines:

      • official Debian packages: deb http://ftp.debian-ports.org/debian unstable main

      • official Debian-Ports m68k packages: deb http://ftp.debian-ports.org/debian unreleased main

      • optionally: deb http://www.freewrt.org/~tg/debs68k/ sid main

      • if you have your own APT staging repo for packages you built, add it there as well, naturally
    • etc/apt/apt.conf and etc/apt/preferences

    • touch CurrentlyBuilding

    • add the man-db stuff to var/cache/debconf/config.dat

  • Run eatmydata cowbuilder --update once, so the chroot is in a sane state

  • Enjoy!

You can also just install the build-essential package and begin compiling in your main system. Or set up a buildd…

Closing Remarks

ThorstenGlaser made this image due to the pressure of several requests for one, while being ill. It has not been tested much, contains way too few packages for its size (looking back, at least the base packages should all have been included, considering how big it ended up anyway due to mc and locales-all and stuff), and the First Steps could probably have been made into a shell script. But, there you are. Better than nothing. It’s at least a working image, cleanly made according to latest Debian sid standards (instead of upgrading old etch-m68k images more and more) and with space to compile lots of things.


CategoryPermalink