Skip to content

Commit

Permalink
Add netboot generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
the-maldridge committed Aug 7, 2017
1 parent 76ea750 commit 414ebf3
Show file tree
Hide file tree
Showing 18 changed files with 444 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.raw
*.tar.gz
xbps-cachedir*
!dracut/*/*.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
85 changes: 85 additions & 0 deletions dracut/netmenu/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

check() {
return 255
}

depends() {
return 0
}

install() {
inst /usr/bin/awk
inst /usr/bin/basename
inst /usr/bin/bash
inst /usr/bin/cat
inst /usr/bin/cfdisk
inst /usr/bin/chroot
inst /usr/bin/clear
inst /usr/bin/cut
inst /usr/bin/cp
inst /usr/bin/dhcpcd
inst /usr/bin/dialog
inst /usr/bin/echo
inst /usr/bin/env
inst /usr/bin/find
inst /usr/bin/find
inst /usr/bin/grep
inst /usr/bin/head
inst /usr/bin/id
inst /usr/bin/ln
inst /usr/bin/ls
inst /usr/bin/lsblk
inst /usr/bin/mke2fs
inst /usr/bin/mkfs.btrfs
inst /usr/bin/mkfs.f2fs
inst /usr/bin/mkfs.vfat
inst /usr/bin/mkfs.xfs
inst /usr/bin/mkswap
inst /usr/bin/mktemp
inst /usr/bin/mount
inst /usr/bin/reboot
inst /usr/bin/rm
inst /usr/bin/sed
inst /usr/bin/sort
inst /usr/bin/sync
inst /usr/bin/stdbuf
inst /usr/bin/sleep
inst /usr/bin/touch
inst /usr/bin/xargs
inst /usr/bin/xbps-install
inst /usr/bin/xbps-reconfigure
inst /usr/bin/xbps-remove
inst /usr/bin/xbps-uhelper

inst /usr/libexec/dhcpcd-hooks/20-resolv.conf
inst /usr/libexec/dhcpcd-run-hooks
inst /usr/libexec/coreutils/libstdbuf.so

inst_multiple /var/db/xbps/keys/*
inst_multiple /usr/share/xbps.d/*
inst_multiple /usr/share/zoneinfo/*/*

inst_multiple /etc/ssl/certs/*
inst /etc/ssl/certs.pem

inst /etc/default/libc-locales
inst /etc/group

# We need to remove a choice here since the installer's initrd
# can't function as a local source. Strictly we shouldn't be
# doing this from dracut's installation function, but this is the
# last place that file really exists 'on disk' in the sense that
# we can modify it, so this change is applied here.
sed -i '/Packages from ISO image/d' "$moddir/installer.sh"

# The system doesn't have a real init up so the reboot is going to
# be rough, we make it an option though if the end user wants to
# do this...
sed -i "s:shutdown -r now:sync && reboot -f:" "$moddir/installer.sh"

inst "$moddir/installer.sh" /usr/bin/void-installer
inst_hook pre-mount 05 "$moddir/netmenu.sh"
}
18 changes: 18 additions & 0 deletions dracut/netmenu/netmenu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

dialog --colors --keep-tite --no-shadow --no-mouse \
--backtitle "\Zb\Z7Void Linux installation -- http://www.voidlinux.eu/\Zn" \
--cancel-label "Reboot" --aspect 20 \
--menu "Select an Action:" 10 50 2 \
"Install" "Run void-installer" \
"Shell" "Run dash" \
2>/tmp/netmenu.action

if ! $? ; then
reboot -f
fi

case $(cat /tmp/netmenu.action) in
"Install") /usr/bin/void-installer ; exec sh ;;
"Shell") exec sh ;;
esac
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions mklive.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ copy_void_conf() {

copy_dracut_files() {
mkdir -p $1/usr/lib/dracut/modules.d/01vmklive
cp dracut/* $1/usr/lib/dracut/modules.d/01vmklive/
cp dracut/vmklive/* $1/usr/lib/dracut/modules.d/01vmklive/
}

copy_autoinstaller_files() {
mkdir -p $1/usr/lib/dracut/modules.d/01autoinstaller
cp autoinstaller/* $1/usr/lib/dracut/modules.d/01autoinstaller/
cp dracut/autoinstaller/* $1/usr/lib/dracut/modules.d/01autoinstaller/
}

install_prereqs() {
Expand Down
Loading

0 comments on commit 414ebf3

Please sign in to comment.