08dcdd5631a24f38a1ff1dfa67b2930e5d4e16a3
[ipfire-2.x.git] / src / installer / dracut-module / module-setup.sh
1 #!/bin/bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4
5 # called by dracut
6 check() {
7 return 255
8 }
9
10 # called by dracut
11 depends() {
12 echo base bash mdraid shutdown
13 return 0
14 }
15
16 # called by dracut
17 install() {
18 inst /etc/system-release
19 inst /usr/bin/installer
20 inst /usr/bin/downloadsource.sh
21 inst /usr/bin/execute-postinstall.sh
22 inst /usr/local/bin/iowrap
23
24 # Kernel drivers
25 instmods =drivers/hid
26
27 # Network drivers
28 instmods =drivers/net/ethernet =drivers/net/usb
29 instmods virtio_net hv_netvsc vmxnet3
30
31 # Filesystem support
32 inst_multiple parted mkswap mke2fs mkreiserfs mkfs.xfs
33 instmods ext4 iso9660 reiserfs vfat xfs
34
35 # Extraction
36 inst_multiple tar gzip lzma xz
37
38 # Networking
39 inst_multiple dhcpcd ethtool hostname ip ping sort wget
40 inst /usr/bin/start-networking.sh
41 inst /var/ipfire/dhcpc/dhcpcd.conf
42 inst /var/ipfire/dhcpc/dhcpcd-run-hooks
43 inst "$moddir/70-dhcpcd.exe" "/var/ipfire/dhcpc/dhcpcd-hooks/70-dhcpcd.exe"
44
45 inst /etc/host.conf /etc/protocols
46 inst /etc/nsswitch.conf /etc/resolv.conf
47 inst_libdir_file "libnss_dns.so.*"
48
49 # Misc. tools
50 inst_multiple chmod cut grep eject id killall md5sum touch
51 inst_multiple -o fdisk cfdisk df ps top
52
53 # Hardware IDs
54 inst /usr/share/hwdata/pci.ids /usr/share/hwdata/usb.ids
55
56 # Locales
57 mkdir -p "${initdir}/usr/lib/locale"
58 localedef --quiet --prefix="${initdir}" --add-to-archive /usr/lib/locale/en_US
59 localedef --quiet --prefix="${initdir}" --add-to-archive /usr/lib/locale/en_US.utf8
60
61 for file in /usr/share/locale/*/LC_MESSAGES/installer.mo; do
62 inst "${file}"
63 done
64
65 # Bash start files
66 inst_multiple /etc/profile /root/.bash_profile /etc/bashrc /root/.bashrc
67 for file in /etc/profile.d/*.sh; do
68 inst "${file}"
69 done
70
71 inst_hook cmdline 99 "$moddir/fake-root.sh"
72 inst_hook pre-mount 99 "$moddir/run-installer.sh"
73
74 return 0
75 }