Skip to content

Instantly share code, notes, and snippets.

@masami256
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masami256/aaff8ebab92755624574 to your computer and use it in GitHub Desktop.
Save masami256/aaff8ebab92755624574 to your computer and use it in GitHub Desktop.
install bzImage to /boot, create initramfs, create boot conf for gummiboot
#!/bin/bash
if [ $# != 4 ]; then
echo "usage $0 [vmlinuz name] [bzimage file name] [System.map file name] [output dir]"
exit 1
fi
KERNEL_NAME=$1
BZIMAGE_NAME=$2
SYSTEMMAP_NAME=$3
BOOT_DIR=$4
VMLINUZ_NAME=vmlinuz-${KERNEL_NAME}
INITRAMFS_NAME=initramfs-${KERNEL_NAME}.img
cp -f ${BZIMAGE_NAME} ${BOOT_DIR}/${VMLINUZ_NAME}
cp -f ${SYSTEMMAP_NAME} ${BOOT_DIR}/System.map-${KERNEL_NAME}
mkinitcpio -k ${KERNEL_NAME} -c /etc/mkinitcpio.conf -g /boot/${INITRAMFS_NAME}
boot_conf=${BOOT_DIR}/loader/entries/${KERNEL_NAME}.conf
cat << EOD > $boot_conf
title ${KERNEL_NAME}
linux /${VMLINUZ_NAME}
initrd /${INITRAMFS_NAME}
options root=/dev/sda2 rw
EOD
echo "${boot_conf}"
cat ${boot_conf}
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment