You are not logged in.

#1 2011-03-28 14:46:25

allencch
Member
Registered: 2011-03-25
Posts: 118

[SOLVED] How to boot custom Arch Linux Installation CD?

I have tried archiso for two days, but still haven't figure out how to work properly. Because I intended to create a custom LiveCD. I also tried ArchBang, by download the zip file from the website, but failed to make.
I have followed the archiso wiki, but the example of the Makefile has some problem, so I modified so that the iso can be "make". The following is the modified Makefile:

#### Change these settings to modify how this ISO is built.
#  The directory that you'll be using for the actual build process.
WORKDIR=work
# INSTALL_DIR -> max 8 chars.
INSTALL_DIR=arch
COMPRESS=gzip
#  A list of packages to install, either space separated in a string or line separated in a file. Can include groups.
PACKAGES="$(shell cat packages.list) syslinux"
# The name of our ISO. Does not specify the architecture!
NAME=myarch
# Version will be appended to the ISO.
VER=1.00
# Kernel version. You'll need this. Don't change it.
kver_FILE=$(WORKDIR)/root-image/etc/mkinitcpio.d/kernel26.kver
# Architecture will also be appended to the ISO name.
ARCH?=$(shell uname -m)
# Current working directory
PWD:=$(shell pwd)
# This is going to be the full name the final iso/img will carry
FULLNAME="$(PWD)"/$(NAME)-$(VER)-$(ARCH)

# Default make instruction to build everything.
all: myarch

# The following will first run the base-fs routine before creating the final iso image.
myarch: base-fs
    mkarchiso -L "ACARCH" -D $(INSTALL_DIR) -c $(COMPRESS) -p syslinux iso "$(WORKDIR)" "$(FULLNAME)".iso

# This is the main rule for make the working filesystem. It will run routines from left to right. 
# Thus, root-image is called first and syslinux is called last.
base-fs: root-image boot-files initcpio overlay iso-mounts syslinux

# The root-image routine is always executed first. 
# It only downloads and installs all packages into the $WORKDIR, giving you a basic system to use as a base.
root-image: "$(WORKDIR)"/root-image/.arch-chroot
"$(WORKDIR)"/root-image/.arch-chroot:
root-image:
    mkarchiso -D $(INSTALL_DIR) -c $(COMPRESS) -p $(PACKAGES) create "$(WORKDIR)"

# Rule for make /boot
boot-files: root-image
    cp -r "$(WORKDIR)"/root-image/boot "$(WORKDIR)"/iso
    cp -r boot-files/* "$(WORKDIR)"/iso/

# Rules for initcpio images
initcpio: "$(WORKDIR)"/iso/boot/kernel26.img
"$(WORKDIR)"/iso/boot/kernel26.img: mkinitcpio.conf "$(WORKDIR)"/root-image/.arch-chroot
    mkdir -p "$(WORKDIR)"/iso/boot
    mkinitcpio -c ./mkinitcpio.conf -b "$(WORKDIR)"/root-image -k `uname -r` -g $@

# See: Overlay
overlay:
    mkdir -p "$(WORKDIR)"/overlay/etc/pacman.d
    cp -r overlay "$(WORKDIR)"/
    wget -O "$(WORKDIR)"/overlay/etc/pacman.d/mirrorlist http://www.archlinux.org/mirrorlist/all/
    sed -i "s/#Server/Server/g" "$(WORKDIR)"/overlay/etc/pacman.d/mirrorlist

# Rule to process isomounts file.
iso-mounts: "$(WORKDIR)"/iso/$(INSTALL_DIR)/isomounts
"$(WORKDIR)"/iso/$(INSTALL_DIR)/isomounts: isomounts root-image
    sed "s|@ARCH@|$(ARCH)|g" isomounts > $@

# This routine is always executed just before generating the actual image. 
syslinux: root-image
    mkdir -p $(WORKDIR)/iso/$(INSTALL_DIR)/boot/$(ARCH)
    mkdir -p $(WORKDIR)/iso/$(INSTALL_DIR)/syslinux
    cp -PR $(WORKDIR)/root-image/usr/lib/syslinux/*.c32 $(WORKDIR)/iso/$(INSTALL_DIR)/syslinux/
    cp -PR $(WORKDIR)/root-image/usr/lib/syslinux/isolinux.bin $(WORKDIR)/iso/$(INSTALL_DIR)/syslinux/

# In case "make clean" is called, the following routine gets rid of all files created by this Makefile.
clean:
    rm -rf "$(WORKDIR)" "$(FULLNAME)".img "$(FULLNAME)".iso

.PHONY: all myarch
.PHONY: base-fs
.PHONY: root-image boot-files initcpio overlay iso-mounts
.PHONY: syslinux
.PHONY: clean

Though the ISO file is successfully made, I failed to boot into the CD. I am trying on Virtualbox.
The first error is:

Could not find kernel image: menu.c32
boot:

Then I enter with "arch" to continue boot, where "arch" is the label.

Then booting as normal, but later an error occured with:

Waiting 30 seconds for device /dev/disk/by-label/ ...
ERROR: boot device didn't show up after 30 seconds...
    Falling back to interactive prompt
    You can try to fix the problem manually, log out when you are finished
/bin/sh: can't access tty; job control turned off
[ramfs /]#

Last edited by allencch (2011-03-29 04:07:30)

Offline

#2 2011-03-29 04:06:39

allencch
Member
Registered: 2011-03-25
Posts: 118

Re: [SOLVED] How to boot custom Arch Linux Installation CD?

I have solved the booting problem, and already make modification towards the Archiso wiki page for the Makefile part.

Last edited by allencch (2011-03-29 04:07:02)

Offline

Board footer

Powered by FluxBB