aboutsummaryrefslogtreecommitdiff
blob: 3775e6a7c24a26e0971cd7b56d85779b9f3576eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash

# called by dracut
check() {
    if [[ -e $moddir/cinit_pre-mount.sh ]]; then
    {
     return 0
    }
    else
    {
     return 1
    }
    fi
}

# called by dracut
install() {
# Hooks the script to clean up phase
    inst_multiple chroot chown chmod ls sed awk mount ls ln umount \
    cp mv busybox rsync ssh gpg bash rmmod dmesg modprobe findmnt \
    tar bzip2 ping clear mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.btrfs mkfs.vfat \
    e2label mlabel swaplabel scp md5sum sha512sum

    mkdir -m 0755 -p ${initdir}/config.d/fetchdir,confdir}
    mkdir -m 0755 -p ${initdir}/config.d/confdir/{local,keys,jobs}
    mkdir -m 0755 -p ${initdir}/etc/gse
    mkdir -m 0755 -p ${initdir}/usr/local/controller
    mkdir -m 700 -p ${initdir}/root/.ssh
    mkdir -m 0755 -p ${initdir}/mnt/{rfs,bfs}
    mkdir -m 0755 -p ${initdir}/mnt/{etc_tmpfs,tmp_tmpfs,var_tmp_tmpfs,workdir_tmp_tmpfs}
    mkdir -m 0755 -p ${initdir}/user-data/persistent/{local,nfs,log,var,etc}
    mkdir -m 0755 -p ${initdir}/user-data/persistent/local/{root,home,data,mnt,media}

    inst_script "$moddir/cchroot.sh" "/usr/local/controller/cchroot.sh"
    inst_script "$moddir/cbootflags.sh" "/usr/local/controller/cbootflags.sh"
    inst_script "$moddir/cfetch.sh" "/usr/local/controller/cfetch.sh"
    inst_script "$moddir/cfunctions.sh" "/usr/local/controller/cfunctions.sh"
    inst_script "$moddir/chealth.sh" "/usr/local/controller/chealth.sh"
    inst_script "$moddir/cnetwork.sh" "/usr/local/controller/cnetwork.sh"
    inst_script "$moddir/cverify.sh" "/usr/local/controller/cverify.sh"
    inst_script "$moddir/cverify.sh" "/usr/local/controller/cverify.sh"
    inst_simple "${CHDIR}/controller/cssh_config" "/etc/ssh/ssh_config"
    inst_simple "${CHDIR}/controller/cknown_hosts" "/root/.ssh/known_hosts"
    inst_simple "${CHDIR}/controller/cssh_priv" "/root/.ssh/ida_rsa"
    inst_simple "${CHDIR}/controller/cgentoo.conf" "/etc/gse/gentoo.conf"
    inst_simple "${CHDIR}/controller/csources.conf" "/etc/gse/sources.conf"
    inst_simple "${CHDIR}/controller/cservers.conf" "/etc/gse/servers.conf"
    inst_simple "${CHDIR}/controller/cfstab" "/etc/fstab"
    inst_simple "${CHDIR}/controller/cnet" "/config.d/confdir/net"
    inst_simple "${CHDIR}/controller/cconsolefont" "/config.d/confdir/consolefont"
    inst_simple "${CHDIR}/controller/crunlevels" "/config.d/confdir/runlevels"
    inst_simple "${CHDIR}/controller/cdevname.info" "/config.d/confdir/devname.info"
    inst_simple "${CHDIR}/controller/conf.d/cfstab.info" "/config.d/confdir/fstab.info"
    inst_simple "${CHDIR}/controller/cgrub" "/config.d/confdir/grub"
    inst_simple "${CHDIR}/controller/ccoptions" "/config.d/confdir/coptions"
    inst_simple "${CHDIR}/controller/chostname" "/config.d/confdir/hostname"
    inst_simple "${CHDIR}/controller/chosts" "/config.d/confdir/hosts"
    inst_simple "${CHDIR}/controller/clocale.gen" "/config.d/confdir/locale.gen"
    inst_simple "${CHDIR}/controller/cssh.pub" "/config.d/confdir/ssh.pub"
    inst_simple "${CHDIR}/controller/csshd_config" "/config.d/confdir/sshd_config"
    inst_simple "${CHDIR}/controller/csystem_links" "/config.d/confdir/system_links"

    inst_hook pre-mount 01 "$moddir/cinit_pre-mount.sh"
    inst_hook mount 01 "$moddir/cinit_mount.sh"
    inst_hook clean 01 "$moddir/cinit_clean.sh"

}