Kamis, 29 Agustus 2013

Xathrya Sabertooth

Xathrya Sabertooth


Installing Slackware ARM on QEMU

Posted: 28 Aug 2013 07:42 PM PDT

Slackware ARM is a Raspberry Pi’s operating system with slackware flavor.

In this article, we will discuss about installing Slackware for ARM using QEMU on top of Slackware64. On this article we will use:

  1. Slackware64 14.0 (as host)
  2. QEMU 14.0
  3. Slackware for ARM (as guest)

Although we have experiment on Slackware64, you can do this in any platform which has installed QEMU.

Obtaining the Materials

First, make sure you have installed QEMU. On Linux you can follow this article. Although we don’t use Windows on this article, you can also install QEMU on Windows using this article.

Create a working directory, let’s say SlackARM. Adjust following command with your own:

mkdir -p ~/run  mkdir -p ~/SlackwareARM    SLACKARM="~/SlackwareARM"  WORKINGDIR="~/run"    cd $SLACKARM  mkdir -p kernels/versatile isolinux slackware  cd slackware  mkdir a l    cd $WORKINGDIR  mkdir hdd

We need a kernel, a also a working initrd.

cd $SLACKARM/kernels/versatile  wget -c "ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.0/kernels/versatile/zImage-versatile"  wget -c "http://xecdesign.com/downloads/linux-qemu/kernel-qemu"  cd $SLACKARM/isolinux  wget -c "ftp://ftp.arm.slackware.com/slackwarearm/slackwarearm-14.0/isolinux/initrd-versatile.img"

Next, create a QEMU hard disk which will be used by our Slackware:

cd $WORKINGDIR/hdd  qemu-img create -f raw slackhdd.img 2G

A 2GB disk is sufficient for our experiments. Then go to $SLACKARM/slackware and downloads following packages from here. For simplicity, We only need a packages and l packages. The packages on “a packages” must be downloaded to “a directory“, while l package must be downloaded to l directory. Remember that both directory should be stored on “slackware” directory. Here is the list:

"a" packages ($SLACKARM/slackware/a)

  1. aaa_base-14.0-arm-4.tgz
  2. aaa_elflibs-14.0-arm-2.tgz
  3. aaa_terminfo-5.8-arm-1.tgz
  4. bash-4.2.037-arm-1.tgz
  5. bin-11.1-arm-2.tgz
  6. coreutils-8.19-arm-1.tgz
  7. e2fsprogs-1.42.6-arm-1.tgz
  8. etc-14.0-arm-1.tgz
  9. kernel-modules-versatile-3.4.11_versatile-arm-1.tgz
  10. kernel_versatile-3.4.11-arm-1.tgz
  11. pkgtools-14.0-noarch-2.tgz
  12. shadow-4.1.4.3-arm-6.tgz
  13. sysvinit-2.88dsf-arm-2.tgz
  14. sysvinit-functions-8.53-arm-1.tgz
  15. sysvinit-scripts-2.0-noarch-9.tgz
  16. util-linux-2.21.2-arm-3.tgz

"l" packages ($SLACKARM/slackware/l)

  1. glibc-2.15-arm-8.tgz

Make iso files with content of isolinux, kernels, and slackware. Do following command:

cd $SLACKARM  mkisofs -udf -o $WORKINGDIR/slackware-arm-14.0.iso -R -J -V "Slackware ARM 14.0" -hide-rr-moved -v -d -N -A "Slackware ARM 14.0" .

Notice the trailing dot as part of command. When done, a new iso file slackware-arm-14.0.iso will be created on $SLACKARM. My iso size is 94.7 MB.

Running the System

With initrd, kernel, and ISO file, let’s march to last step which is running the system. Do followings:

cd $WORKINGDIR  qemu-system-arm -m 512 -M versatilepb -kernel $SLACKARM/kernels/versatile/zImage-versatile \  -initrd $SLACKARM/isolinux/initrd-versatile.img -hda hdd/slackhdd.img -cdrom slackware-arm-14.0.iso

Some error messages might shown such as:

/bin/grep: No such file or directory

But don’t worry, if you follow this article you now have SlackwareARM installed on QEMU.

You can proceed like you always do in Slackware installation. Once you done the installation, just quit QEMU.

To boot QEMU for normal operation (not installation), do:

qemu-system-arm -M versatilepb -kernel $SLACKARM/kernels/versatile/kernel-qemu \  -hda hdd/slackhdd.img -append 'root=/dev/sda1' \  -no-reboot -serial stdio

Have fun!

Note: You can also use the slackware-current instead of slackware-14.0. I will leave this as an exercise

Tidak ada komentar:

Posting Komentar