[arch-commits] Commit in mksyslinux/repos (6 files)

Felix Yan felixonmars at archlinux.org
Sat May 16 09:34:07 UTC 2020


    Date: Saturday, May 16, 2020 @ 09:34:06
  Author: felixonmars
Revision: 383891

archrelease: copy trunk to staging-any

Added:
  mksyslinux/repos/staging-any/
  mksyslinux/repos/staging-any/PKGBUILD
    (from rev 383889, mksyslinux/trunk/PKGBUILD)
  mksyslinux/repos/staging-any/boot.msg
    (from rev 383889, mksyslinux/trunk/boot.msg)
  mksyslinux/repos/staging-any/mksyslinux
    (from rev 383889, mksyslinux/trunk/mksyslinux)
  mksyslinux/repos/staging-any/mksyslinux.conf
    (from rev 383889, mksyslinux/trunk/mksyslinux.conf)
  mksyslinux/repos/staging-any/options.msg
    (from rev 383889, mksyslinux/trunk/options.msg)

-----------------+
 PKGBUILD        |   25 +++++++++
 boot.msg        |   14 +++++
 mksyslinux      |  144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mksyslinux.conf |   33 ++++++++++++
 options.msg     |    6 ++
 5 files changed, 222 insertions(+)

Copied: mksyslinux/repos/staging-any/PKGBUILD (from rev 383889, mksyslinux/trunk/PKGBUILD)
===================================================================
--- staging-any/PKGBUILD	                        (rev 0)
+++ staging-any/PKGBUILD	2020-05-16 09:34:06 UTC (rev 383891)
@@ -0,0 +1,25 @@
+# Maintainer : Tobias Powalowski <tpowa at archlinux.org>
+
+pkgname=mksyslinux
+pkgver=2013.06
+pkgrel=3
+pkgdesc="Advanced, modular syslinux boot image creation utility"
+arch=(any)
+license=('GPL')
+url="http://www.archlinux.org/"
+depends=('mkinitcpio' 'syslinux' 'pciutils')
+backup=(etc/mksyslinux.conf)
+source=('boot.msg' 'mksyslinux' 'mksyslinux.conf' 'options.msg')
+
+package()
+{
+  cd "$srcdir/"
+  install -D -m755 mksyslinux "$pkgdir/usr/bin/mksyslinux"
+  install -D -m644 mksyslinux.conf "$pkgdir/etc/mksyslinux.conf"
+  install -D -m644 boot.msg "$pkgdir/usr/share/mksyslinux/boot.msg"
+  install -D -m644 options.msg  "$pkgdir/usr/share/mksyslinux/options.msg"
+}
+md5sums=('6a269fc5b58c7bcc6688efeaa2075606'
+         '5388bd1d69b03f20bcd26d08da11bcf5'
+         '6b37cb9cb766a5f6482908c5248233c6'
+         'b211c5f7e30d2ee36cde20f71aa3f2b8')

Copied: mksyslinux/repos/staging-any/boot.msg (from rev 383889, mksyslinux/trunk/boot.msg)
===================================================================
--- staging-any/boot.msg	                        (rev 0)
+++ staging-any/boot.msg	2020-05-16 09:34:06 UTC (rev 383891)
@@ -0,0 +1,14 @@
+
+
+------------------------------------------------------------------------------
+Arch Linux
+SYSLINUX BOOT
+created with 'mksyslinux' by Tobias Powalowski <tpowa at archlinux.org>
+
+Press ENTER or type 'arch' to boot image.
+
+If you wish to change your defaults to boot into your existing system,
+type 'vmlinuz initrd=initrd.img <any_other_boot_option>'
+Use the F2 key for troubleshooting and options.
+------------------------------------------------------------------------------
+

Copied: mksyslinux/repos/staging-any/mksyslinux (from rev 383889, mksyslinux/trunk/mksyslinux)
===================================================================
--- staging-any/mksyslinux	                        (rev 0)
+++ staging-any/mksyslinux	2020-05-16 09:34:06 UTC (rev 383891)
@@ -0,0 +1,144 @@
+#! /bin/sh
+# Created by Tobias Powalowski <tpowa at archlinux.org>
+# Settings
+APPNAME=$(basename "${0}")
+CONFIG="/etc/mksyslinux.conf"
+export TEMPDIR=$(mktemp /tmp/mksyslinux.XXX)
+TMPDIR=$(mktemp -d /tmp/mksyslinux-image.XXX)
+BOOTDIRNAME=boot/syslinux
+
+usage ()
+{
+    echo "${APPNAME}: usage"
+    echo "WRITING TO DEVICE:"
+    echo "- PREPARATION: Your device must have a bootable first partition in FAT16 format!"
+    echo "- ATTENTION: The MBR of your DEVICE will be overwritten! You have been warned!"
+    echo ""
+    echo "CREATING AN IMAGE FILE:"
+    echo "- For creating an image file use the -i=IMAGEFILE switch"
+    echo "- use 'dd if=<yourimage> of=<yourdevice>' to write to your device afterwards."
+    echo ""
+    echo "PARAMETERS:"
+    echo "  -d=DEVICE        Your DEVICE first partition from /dev/xxx tree to install"
+    echo "  -i=IMAGENAME     Your IMAGENAME"
+    echo "  -c=CONFIG        Use CONFIG file. default: /etc/mksyslinux.conf"
+    echo "  -h               This message."
+    exit 1
+}
+
+[ "$1" == "" ] && usage && exit 1
+
+
+while [ $# -gt 0 ]; do
+	case $1 in
+		-c=*|--c=*) CONFIG="$(echo $1 | awk -F= '{print $2;}')" ;;
+		-d=*|--d=*) DEVICE="$(echo $1 | awk -F= '{print $2;}')" ;;
+		-i=*|--i=*) IMAGENAME="$(echo $1 | awk -F= '{print $2;}')" ;;
+		-h|--h|?) usage ;; 
+		*) usage ;;
+		esac
+	shift
+done
+
+if [ ! -f "${CONFIG}" ]; then
+	echo "config file '${CONFIG}' cannot be found, aborting..."
+    exit 1
+fi
+
+if [ "${IMAGENAME}" = "" ]; then
+	if [ "${DEVICE}" = "" ]; then 
+		echo "ERROR: No DEVICE name specified, please use the -d option"
+	 	exit 1
+	fi
+fi
+
+if ! [ $UID -eq 0 ]; then 
+	echo "ERROR: only works when run as root!"
+	exit 1
+fi
+
+. "${CONFIG}"
+# export for mkinitcpio
+[ -n "${APPENDBOOTMESSAGE}" ] && export APPENDBOOTMESSAGE
+[ -n "${APPENDBOOTMESSAGE_SYSLINUX}" ] && export APPENDBOOTMESSAGE_SYSLINUX
+[ -n "${APPENDOPTIONSBOOTMESSAGE}" ] && export APPENDOPTIONSBOOTMESSAGE
+
+MBRDEVICE="$(echo ${DEVICE} | sed -e 's/[0-9]//g')"
+
+export RUNPROGRAM="${APPNAME}"
+[ "${BOOTMESSAGE}" = "" ] && export BOOTMESSAGE=$(mktemp /tmp/bootmessage.XXXX)
+[ "${OPTIONSBOOTMESSAGE}" = "" ] && export OPTIONSBOOTMESSAGE=$(mktemp /tmp/optionsbootmessage.XXXX)
+export USEKERNEL=${VERSION}
+# begin script
+[ -e ${TEMPDIR} ] && rm -r ${TEMPDIR}
+mkdir -p ${TEMPDIR}
+echo ":: Mounting ${DEVICE} ..."
+if ! [ "${IMAGENAME}" = "" ]; then
+	modprobe loop
+else
+	mount ${DEVICE} ${TEMPDIR} || exit 1
+fi
+mkdir -p ${TEMPDIR}/${BOOTDIRNAME}
+# prepare syslinux bootloader
+install -m755 /usr/lib/syslinux/isolinux.bin ${TEMPDIR}/${BOOTDIRNAME}/isolinux.bin
+for i in /usr/lib/syslinux/*.c32; do
+    install -m644 $i ${TEMPDIR}/${BOOTDIRNAME}/$(basename $i)
+done
+install -m644 /usr/share/hwdata/pci.ids ${TEMPDIR}/${BOOTDIRNAME}/pci.ids
+
+# create syslinux.cfg
+echo ":: Creating syslinux.cfg ..."
+if [ "${SYSLINUXCFG}" = "" ]; then
+	[ -e ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg ] && rm ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "prompt ${PROMPT}" >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "timeout ${TIMEOUT}" >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "display boot.msg" >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "F1 boot.msg" >>  ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "F2 options.msg" >>  ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "default arch"  >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "label arch" >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "kernel /boot/vmlinuz" >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+	echo "append initrd=/boot/initrd.img ${KERNEL_BOOT_OPTIONS}" >> ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+else
+	sed "s|@@PROMPT@@|${PROMPT}|g;s|@@TIMEOUT@@|${TIMEOUT}|g;s|@@KERNEL_BOOT_OPTIONS@@|${KERNEL_BOOT_OPTIONS}|g" \
+		${SYSLINUXCFG} > ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg
+fi
+[ ! -s ${TEMPDIR}/${BOOTDIRNAME}/syslinux.cfg ] && echo "No syslinux.cfg found" && exit 1
+echo ":: Calling mkinitcpio CONFIG=${MKINITCPIO_CONFIG} KERNEL=${VERSION} ..." 
+# generate initramdisk
+echo ":: Creating initramdisk ..."
+	mkinitcpio -c ${MKINITCPIO_CONFIG} -k ${VERSION} -g ${TEMPDIR}/boot/initrd.img
+echo ":: Using ${KERNEL} as image kernel ..."
+	install -m644 ${KERNEL} ${TEMPDIR}/boot/vmlinuz
+	install -m644 ${BOOTMESSAGE} ${TEMPDIR}/${BOOTDIRNAME}/boot.msg
+	install -m644 ${OPTIONSBOOTMESSAGE} ${TEMPDIR}/${BOOTDIRNAME}/options.msg
+	[ ! -s ${TEMPDIR}/${BOOTDIRNAME}/boot.msg ] && echo 'ERROR:no boot.msg found, aborting!' && exit 1
+	[ ! -s ${TEMPDIR}/${BOOTDIRNAME}/options.msg ] && echo 'ERROR:no options.msg found, aborting!' && exit 1
+if ! [ "${IMAGENAME}" = "" ]; then
+	# ext2 overhead's upper bound is 6%
+	# empirically tested up to 1GB
+	rootsize=$(du -bs ${TEMPDIR}|cut -f1)
+	IMGSZ=$(( (${rootsize}*106)/100/512 + 1)) # image size in sectors
+	# create the filesystem image file
+	dd if=/dev/zero of="${IMAGENAME}" bs=512 count="${IMGSZ}"
+	# create a filesystem on the image
+	mkfs.vfat "${IMAGENAME}"
+	mount -o loop ${IMAGENAME} ${TMPDIR} || exit 1
+	cp -r "${TEMPDIR}"/* "$TMPDIR"
+	umount ${TMPDIR}
+else
+	echo ":: Unmounting ${DEVICE} ..."
+	umount ${TEMPDIR} || exit 1
+fi
+if ! [ "${IMAGENAME}" = "" ]; then
+	echo ":: Installing SYSLINUX on ${IMAGENAME} ..."
+	syslinux ${IMAGENAME} && echo "Installation completed."
+else
+	echo ":: Installing MBR on ${MBRDEVICE} ..."
+	cat ${MBR} > ${MBRDEVICE}
+	echo ":: Installing SYSLINUX on ${DEVICE} ..."
+	syslinux -t offset ${DEVICE} && echo "Installation completed."
+fi
+# clean /tmp
+rm -r ${TEMPDIR}
+! [ ${IMAGENAME} = "" ] && rm -r ${TMPDIR}
\ No newline at end of file

Copied: mksyslinux/repos/staging-any/mksyslinux.conf (from rev 383889, mksyslinux/trunk/mksyslinux.conf)
===================================================================
--- staging-any/mksyslinux.conf	                        (rev 0)
+++ staging-any/mksyslinux.conf	2020-05-16 09:34:06 UTC (rev 383891)
@@ -0,0 +1,33 @@
+# Created by Tobias Powalowski <tpowa at archlinux.org>
+# config file of mksyslinux
+
+# DEFAULT kernel boot options like root=/dev/sda3 etc.
+# add your root= option, if you boot from a disk device
+# and don't want to add it by hand on each boot
+KERNEL_BOOT_OPTIONS=""
+
+# mkinitcpio config file, defaulted to stock config file
+MKINITCPIO_CONFIG="/etc/mkinitcpio.conf"
+
+# kernel version, defaulted to build for runtime kernel
+VERSION="$(uname -r)"
+
+# kernel image, defaulted to stock arch kernel
+KERNEL="/boot/vmlinuz-linux"
+
+# boot message files
+BOOTMESSAGE="/usr/share/mksyslinux/boot.msg"
+OPTIONSBOOTMESSAGE="/usr/share/mksyslinux/options.msg"
+
+# syslinux.cfg file to use
+SYSLINUXCFG=""
+
+# Prompt on boot, 1=yes 0=no
+PROMPT="1"
+
+# Timeout, 30 seconds to fix usb keyboard issues
+# 0 means wait for prompt
+TIMEOUT="300"
+
+# default MBR
+MBR="/usr/lib/syslinux/mbr.bin"

Copied: mksyslinux/repos/staging-any/options.msg (from rev 383889, mksyslinux/trunk/options.msg)
===================================================================
--- staging-any/options.msg	                        (rev 0)
+++ staging-any/options.msg	2020-05-16 09:34:06 UTC (rev 383891)
@@ -0,0 +1,6 @@
+------------------------------------------------------------------------------
+Arch Linux options and troubleshooting:
+
+- If your system hangs during the boot process, any combinations of the
+  boot options noapic acpi=off pci=routeirq nosmp nomsi may be useful.
+------------------------------------------------------------------------------
\ No newline at end of file


More information about the arch-commits mailing list