Subject: [alpine-devel] Problems building ISO/img (especially for pxe boot)

From: Franz Bettag <[email-masked]>
Date: Sun, 27 Oct 2013 23:57:41 +0100

Hey guys,

i'm trying to build ISOs using the alpine-iso git-repo Makefile, sadly it does not work at all. My first idea was to create .img files to be able to boot using memdisk, but apparently that does not work as well.

buildhost:~/alpine-iso# make PROFILE="alpine-rescue" img
==> modloop: Unpacking kernel modules
Downloading linux-grsec-3.10.17-r1
Downloading linux-firmware-20130506-r0
Downloading dahdi-linux-2.7.0-r0
==> modloop: building image grsec.modloop.squashfs
Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /root/alpine-iso/isotmp.alpine-rescue/isofs/boot/grsec.modloop.squashfs, block size 131072.
[=========================================================================================================================================\] 4177/4177 100%
Exportable Squashfs 4.0 filesystem, xz compressed, data block size 131072
	compressed data, compressed metadata, compressed fragments, compressed xattrs
	duplicates are removed
Filesystem size 54473.57 Kbytes (53.20 Mbytes)
	33.49% of uncompressed filesystem size (162667.96 Kbytes)
Inode table size 34604 bytes (33.79 Kbytes)
	24.48% of uncompressed inode table size (141343 bytes)
Directory table size 42380 bytes (41.39 Kbytes)
	45.51% of uncompressed directory table size (93126 bytes)
Number of duplicate files found 54
Number of inodes 4309
Number of files 3626
Number of fragments 707
Number of symbolic links  7
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 676
Number of ids (unique uids + gids) 1
Number of uids 1
	root (0)
Number of gids 1
	root (0)
Downloading acct-6.5.5-r0
Downloading alpine-base-2.6.6-r0
Downloading alpine-baselayout-2.2.0-r6
Downloading alpine-conf-2.12.0-r4
Downloading alpine-keys-1.0-r0
Downloading apk-tools-2.4.0-r1
Downloading busybox-1.21.1-r0
Downloading busybox-initscripts-2.2-r15
Downloading dahdi-linux-2.7.0-r0
Downloading libc-0.9.33.2-r21
Downloading libc-utils-0.1-r0
Downloading libcrypto1.0-1.0.1e-r3
Downloading linux-firmware-20130506-r0
Downloading linux-grsec-3.10.17-r1
Downloading mkinitfs-2.5.0-r0
Downloading openrc-0.11.8-r0
Downloading uclibc-utils-0.9.33.2-r21
Downloading zlib-1.2.8-r0
==> initramfs: creating /root/alpine-iso/isotmp.alpine-rescue/isofs/boot/grsec.gz
==> iso: configure isolinux
==> iso: install isolinux
Downloading syslinux-5.02_pre3-r1
==> iso: install ldlinux.c32
Downloading syslinux-5.02_pre3-r1
==> iso: install libutil.c32
Downloading syslinux-5.02_pre3-r1
==> iso: install libcom32.c32
Downloading syslinux-5.02_pre3-r1
==> iso: install mboot.c32
Downloading syslinux-5.02_pre3-r1
==> iso: install kernel 3.10.17-grsec
Downloading linux-grsec-3.10.17-r1
Downloading ntfs-3g-2013.1.13-r0
Downloading libpthread-0.9.33.2-r21
Downloading libc-0.9.33.2-r21
Downloading libgcc-4.7.3-r6
Downloading alpine-conf-2.12.0-r4
Downloading uclibc-utils-0.9.33.2-r21
Downloading alpine-base-2.6.6-r0
Downloading apk-tools-2.4.0-r1
Downloading zlib-1.2.8-r0
Downloading libc-utils-0.1-r0
Downloading alpine-keys-1.0-r0
Downloading busybox-1.21.1-r0
Downloading libcrypto1.0-1.0.1e-r3
Downloading alpine-baselayout-2.2.0-r6
Downloading busybox-initscripts-2.2-r15
Downloading openrc-0.11.8-r0
Downloading lvm2-2.02.98-r2
Downloading device-mapper-2.02.98-r2
Downloading libuuid-2.22.2-r0
Downloading e2fsprogs-1.42.7-r0
Downloading libblkid-2.22.2-r0
Downloading libcom_err-1.42.7-r0
Downloading bkeymaps-1.13-r2
Downloading openssh-6.2_p2-r0
Downloading openssh-client-6.2_p2-r0
Downloading mdadm-3.2.6-r0
Downloading ncurses-libs-5.9-r1
Downloading parted-3.1-r0
Downloading readline-6.2.004-r0
Downloading ncurses-base-5.9-r1
Downloading alpine-mirrors-2.6-r0
Downloading wpa_supplicant-2.0-r0
Downloading libssl1.0-1.0.1e-r3
Downloading libnl3-3.2.21-r0
Downloading bridge-1.5-r3
Downloading vlan-1.9-r1
Downloading network-extras-1.0-r0
Downloading wireless-tools-29-r4
Downloading dbus-libs-1.6.10-r0
Downloading bonding-2.6-r3
Downloading tzdata-2013c-r0
Downloading dpkg-1.16.10-r0
Downloading tar-1.26-r1
Downloading libbz2-1.0.6-r2
Downloading debootstrap-1.0.48-r0
==> iso: generating repository index
WARNING: No provider for dependency 'binutils'
WARNING: No provider for dependency 'openssl'
WARNING: No provider for dependency 'libthread_db'
WARNING: No provider for dependency 'libacl'
WARNING: No provider for dependency 'bash'
WARNING: No provider for dependency 'pkgconfig'
WARNING: No provider for dependency 'bzip2'
WARNING: No provider for dependency 'patch'
WARNING: No provider for dependency 'sudo'
WARNING: Too many unsatisfiable dependencies, not reporting the rest.
WARNING: Total of 45 unsatisfiable package names. Your repository maybe broken.
Index has 45 packages (of which 45 are new)
Signed /root/alpine-iso/isotmp.alpine-rescue/isofs/apks/x86_64/APKINDEX.tar.gz
==> iso: configure syslinux
==> Generating alpine-rescue-131027-x86_64.img

I'm not sure about those WARNING, but anyway, after trying to boot this img (i also tried the ISO), i get this:

SYSLINUX 5.02 CHS 5.02-pre3 Copyright (C) 1994-2013 H. Peter Anvin et al
boot:
[    0.000000] tsc: Fast TSC calibration failed
Alpine Init 2.5.0-r0
/sbin/init not found in new root. Launching emergency recovery shell
Type exit to continue to boot.
sh: can't access tty; job control turned off
/ #

I also tried booting it using PXE and memdisk which resulted in this here:

SYSLINUX 5.02 CHS 5.02-pre3 Copyright (C) 1994-2013 H. Peter Anvin et al
boot:
[    0.000000] tsc: Fast TSC calibration failed
Alpine Init 2.5.0-r0
Mounting boot media failed.
initramfs emergency recovery shell launched. Type 'exit' to continue boot
sh: can't access tty; job control turned off
/ #

I already compared the generated img/iso files against the downloaded versions, which only seem to differ in the squashfs image size.
syslinux.cfg on the downloaded .iso and the generated one are the same.

Simplest way to reproduce i guess is to try the wiki tutorial (http://wiki.alpinelinux.org/wiki/How_to_make_a_custom_ISO_image) yourself and test the resulting iso/img with Qemu or VirtualBox.

Franz
----
Black Belt DevOp, Lift Committer and Director of R&D.
Twitter: http://twitter.com/fbettag
GitHub: http://github.com/fbettag
Personal: http://www.uberblo.gs
Business: http://www.wasted.io