installer: Create dracut module

There is now a new installer module for dracut which
will take the installer and put it into the ramdisk.
This commit is contained in:
Michael Tremer
2014-07-27 16:42:56 +02:00
parent 819f72f263
commit 5fca8d27d8
53 changed files with 116 additions and 227 deletions

View File

@@ -33,7 +33,7 @@ LINK = $(LD) $(LDFLAGS)
all : programs
programs : install
programs : installer
clean :
-rm -f *.o install core
@@ -42,7 +42,7 @@ clean :
OBJS=main.o config.o ../libsmooth/libsmooth.o unattended.o hw.o
install: $(OBJS)
installer: $(OBJS)
$(LINK) $(OBJS) -o $@ $(LIBS)
%.o : %.c

View File

@@ -0,0 +1,32 @@
#/bin/bash
########################################################################
# Begin
#
# Description : DHCP Client Script (initrd version)
#
# Authors : Arne Fitzenreiter - arne_f@ipfire.org
#
# Version : 02.00
#
# Notes :
#
########################################################################
dhcpcd_up()
{
set | grep "^new_" | sed "s|^new_||g" | \
sed "s|'||g" | \
sort > /var/ipfire/dhcpc/dhcpcd-$interface.info
DNS=`grep "domain_name_servers" /var/ipfire/dhcpc/dhcpcd-$interface.info | cut -d"=" -f2`
DNS1=`echo $DNS | cut -d" " -f1`
DNS2=`echo $DNS | cut -d" " -f2`
echo "nameserver $DNS1" > /etc/resolv.conf
echo "nameserver $DNS2" >> /etc/resolv.conf
}
case "$reason" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) dhcpcd_up;;
esac

View File

@@ -0,0 +1,5 @@
#!/bin/sh
# Fake root so dracut will start our installer
root="installer"
rootok=1

View File

@@ -0,0 +1,63 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# called by dracut
check() {
return 255
}
# called by dracut
depends() {
echo base bash mdraid shutdown
return 0
}
# called by dracut
install() {
inst /usr/bin/installer
inst /usr/bin/downloadsource.sh
inst /usr/local/bin/iowrap
# Kernel drivers
instmods =drivers/hid
# Network drivers
instmods =drivers/net/ethernet =drivers/net/usb
instmods virtio_net hv_netvsc vmxnet3
# Filesystem support
inst_multiple parted mkswap mke2fs mkreiserfs
instmods ext4 iso9660 reiserfs vfat
# Extraction
inst_multiple tar gzip lzma xz
# DHCP Client
inst dhcpcd
inst /var/ipfire/dhcpc/dhcpcd-run-hooks
inst /var/ipfire/dhcpc/dhcpcd.conf
for file in /var/ipfire/dhcpc/dhcpcd-hooks/*; do
inst "${file}"
done
inst "$moddir/70-dhcpcd.exe" "/var/ipfire/dhcpc/dhcpcd-hooks/70-dhcpcd.exe"
# Misc. tools
inst_multiple eject ping wget
inst_multiple -o fdisk cfdisk
# Hardware IDs
inst /usr/share/hwdata/pci.ids /usr/share/hwdata/usb.ids
# Locales
for locale in de en es fr nl pl ru tr; do
for file in $(find /usr/lib/locale/${locale}*); do
inst "${file}"
done
done
inst_hook cmdline 99 "$moddir/fake-root.sh"
inst_hook pre-mount 99 "$moddir/run-installer.sh"
return 0
}

View File

@@ -0,0 +1,20 @@
#!/bin/sh
#
# IPFire Installer RC
#
# Silence the kernel
echo >/proc/sys/kernel/printk "1 4 1 7"
echo -n -e "\033[9;0]"
echo "Starting shells on tty2 and tty3 ..."
/usr/local/bin/iowrap /dev/tty2 /bin/bash &
/usr/local/bin/iowrap /dev/tty3 /bin/bash &
echo "Loading Installer..."
/bin/bash --login -c "/usr/bin/installer /dev/tty2"
sleep 60
# Reboot the system
/shutdown reboot