[syslinux] USB boot problems on Gigabyte GA-M55Plus-S3G

Dean Graff graff97 at gmail.com
Sun Jan 19 16:56:52 PST 2014


#!/bin/sh
# Make a simple linux installation from scratch,
# which boots to login, on a "hard disk image"
# Maybe Mr.Alvin or Gene could show how to boot it
# with asm. thanks,   -chris graff

y="$(pwd)" # set absolute path
x="${y}/build" # set absolute path to "build" dir
mkdir -p "${x}" # make that "build" dir
JOBZ="-j$(grep -c ^processor /proc/cpuinfo)" # set ideal num of jobs
dd if=/dev/zero of=binary.img bs=1M count=150
mkfs.ext4 -F binary.img
sudo mount binary.img "${x}"
mkdir -p "${x}"/dev "${x}"/proc "${x}"/boot "${x}"/etc "${x}"/root
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
make -C linux menuconfig
make -C linux $JOBZ
make -C linux INSTALL_MOD_PATH="${x}" modules_install
make -C linux install INSTALL_PATH="${x}/boot" 2>/dev/null
ln "${x}"/boot/vmlinuz* "${x}"/boot/vmlinuz
git clone git://git.kernel.org/pub/scm/boot/syslinux/syslinux.git
make -C syslinux $JOBZ
git clone git://busybox.net/busybox.git
make -C busybox defconfig
sed -i 's|# CONFIG_STATIC is not set|CONFIG_STATIC=y|g' busybox/.config
make -C busybox $JOBZ
make -C busybox CONFIG_PREFIX="${x}" install
cat > "${x}"/etc/inittab << EOF
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -o remount,rw /
null::sysinit:/bin/mkdir -p /dev/pts
null::sysinit:/bin/mkdir -p /dev/shm
null::sysinit:/bin/mount -a
null::sysinit:/bin/hostname -F /etc/hostname
tty1::respawn:/sbin/getty -L tty1 115200 vt100
null::shutdown:/bin/umount -a -r
null::shutdown:/bin/swapoff -a
EOF
cat > "${x}"/etc/fstab << EOF
proc /proc proc defaults 0 0
EOF
cat > "${x}"/etc/hostname << EOF
blank
EOF
cat > "${x}"/etc/passwd << EOF
root::0:0:root:/root:/bin/ash
EOF
sudo ./syslinux/extlinux/extlinux --install "${x}"
cat > "${x}"/extlinux.conf << EOF
default linux
label linux
kernel /boot/vmlinuz
append init=/sbin/init root=/dev/sda rw
EOF
sudo umount "${x}"
kvm binary.img # boot the resulting image


More information about the Syslinux mailing list