diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-12 17:19:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-12 17:19:55 +0100 |
commit | a28652bb4a5baf7307f8d2f29bb765e18705cfb8 (patch) | |
tree | 265fdb1627ea65e033187b6577c5a801e22b29ba | |
parent | d20b59f5b32fec29809795ac18b615cd0bac9798 (diff) |
day 3 : split even more
-rw-r--r-- | src/backend/commands_jail.sh (renamed from src/backend/jailcmds.sh) | 0 | ||||
-rw-r--r-- | src/backend/functions_generic.sh | 48 | ||||
-rw-r--r-- | src/backend/functions_makeiso.sh | 0 | ||||
-rw-r--r-- | src/backend/functions_makepkg.sh (renamed from src/backend/jailfuncs.sh) | 47 | ||||
-rw-r--r-- | src/backend/functions_modeswitch.sh | 0 | ||||
-rw-r--r-- | src/backend/libvasile.sh | 36 | ||||
-rw-r--r-- | src/backend/variables_jail.sh (renamed from src/backend/jailvars.sh) | 0 |
7 files changed, 75 insertions, 56 deletions
diff --git a/src/backend/jailcmds.sh b/src/backend/commands_jail.sh index fe5e82b..fe5e82b 100644 --- a/src/backend/jailcmds.sh +++ b/src/backend/commands_jail.sh diff --git a/src/backend/functions_generic.sh b/src/backend/functions_generic.sh new file mode 100644 index 0000000..d692c46 --- /dev/null +++ b/src/backend/functions_generic.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +checkifroot () { + if [[ "$(whoami)" != root ]] ; then + eerror "I won't do that, unless you're root!" + exit 1 + fi +} + +checkkerncfg () { + if [[ $(zgrep 'CONFIG_OVERLAY_FS=' /proc/config.gz) && $(zgrep "CONFIG_SQUASHFS=" /proc/config.gz) && $(zgrep "CONFIG_BLK_DEV_LOOP=" /proc/config.gz) ]] ; then + einfo "Kernel config OK, moving on" + else + eerror "I won't do that with the current kernel" + eerror "I want a kernel with OVERLAYFS && SQUASHFS && LOOP DEVICES enabled" + exit 1 + fi +} + +checkiflive () { + if [[ -L /dev/mapper/live-base ]] ; then + eerror "I won't do that on a live system" + exit 1 + fi +} + +checkjailsum () { + if [[ -f "$jailx64" && -f "$jailx64sum" ]] ; then + if [[ "$(md5sum -c "$jailx64sum")" ]] ; then + einfo "Jail integrity OK, moving on" + else + eerror "I won't do that with a corrupted jail" + exit 1 + fi + else + eerror "I won't do that with a missing jail" + exit 1 + fi +} + +jaildkmsbuild () { + checkifroot + if [[ -x /usr/sbin/dkms ]] ; then + for i in $(dkms status | cut -d " " -f1,2 | sed -e 's/,//g' | sed -e 's/ /\//g' | sed -e 's/://g') ; do + dkms install $i + done + fi +} diff --git a/src/backend/functions_makeiso.sh b/src/backend/functions_makeiso.sh new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/backend/functions_makeiso.sh diff --git a/src/backend/jailfuncs.sh b/src/backend/functions_makepkg.sh index 37b382b..5f60046 100644 --- a/src/backend/jailfuncs.sh +++ b/src/backend/functions_makepkg.sh @@ -1,52 +1,5 @@ #!/usr/bin/env bash -checkifroot () { - if [[ "$(whoami)" != root ]] ; then - eerror "I won't do that, unless you're root!" - exit 1 - fi -} - -checkkerncfg () { - if [[ $(zgrep 'CONFIG_OVERLAY_FS=' /proc/config.gz) && $(zgrep "CONFIG_SQUASHFS=" /proc/config.gz) && $(zgrep "CONFIG_BLK_DEV_LOOP=" /proc/config.gz) ]] ; then - einfo "Kernel config OK, moving on" - else - eerror "I won't do that with the current kernel" - eerror "I want a kernel with OVERLAYFS && SQUASHFS && LOOP DEVICES enabled" - exit 1 - fi -} - -checkiflive () { - if [[ -L /dev/mapper/live-base ]] ; then - eerror "I won't do that on a live system" - exit 1 - fi -} - -checkjailsum () { - if [[ -f "$jailx64" && -f "$jailx64sum" ]] ; then - if [[ "$(md5sum -c "$jailx64sum")" ]] ; then - einfo "Jail integrity OK, moving on" - else - eerror "I won't do that with a corrupted jail" - exit 1 - fi - else - eerror "I won't do that with a missing jail" - exit 1 - fi -} - -jaildkmsbuild () { - checkifroot - if [[ -x /usr/sbin/dkms ]] ; then - for i in $(dkms status | cut -d " " -f1,2 | sed -e 's/,//g' | sed -e 's/ /\//g' | sed -e 's/://g') ; do - dkms install $i - done - fi -} - jailpkgprep () { while : true ; do if [[ ! -d "$ropath" && ! -d "$rwpath" && ! -d "$workpath" && ! -d "$overlaypath" ]] ; then diff --git a/src/backend/functions_modeswitch.sh b/src/backend/functions_modeswitch.sh new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/backend/functions_modeswitch.sh diff --git a/src/backend/libvasile.sh b/src/backend/libvasile.sh index ee2e357..79a46ab 100644 --- a/src/backend/libvasile.sh +++ b/src/backend/libvasile.sh @@ -7,20 +7,38 @@ else exit 1 fi -if [[ -f /usr/lib/vasile/jailvars.sh ]] ; then - source /usr/lib/vasile/jailvars.sh +if [[ -f /usr/lib/vasile/variables_jail.sh ]] ; then + source /usr/lib/vasile/variables_jail.sh else - source jailvars.sh + source variables_jail.sh fi -if [[ -f /usr/lib/vasile/jailcmds.sh ]] ; then - source /usr/lib/vasile/jailcmds.sh +if [[ -f /usr/lib/vasile/commands_jail.sh ]] ; then + source /usr/lib/vasile/commands_jail.sh else - source jailvars.sh + source commands_jail.sh fi -if [[ -f /usr/lib/vasile/jailfuncs.sh ]] ; then - source /usr/lib/vasile/jailfuncs.sh +if [[ -f /usr/lib/vasile/gfunctions_generic.sh ]] ; then + source /usr/lib/vasile/functions_generic.sh else - source jailfuncs.sh + source functions_generic.sh +fi + +if [[ -f /usr/lib/vasile/functions_makepkg.sh ]] ; then + source /usr/lib/vasile/functions_makepkg.sh +else + source functions_makepkg.sh +fi + +if [[ -f /usr/lib/vasile/functions_makeiso.sh ]] ; then + source /usr/lib/vasile/functions_makeiso.sh +else + source functions_makeiso.sh +fi + +if [[ -f /usr/lib/vasile/functions_modeswitch.sh ]] ; then + source /usr/lib/vasile/functions_modeswitch.sh +else + source functions_modeswitch.sh fi diff --git a/src/backend/jailvars.sh b/src/backend/variables_jail.sh index 4a08a26..4a08a26 100644 --- a/src/backend/jailvars.sh +++ b/src/backend/variables_jail.sh |