summaryrefslogtreecommitdiff
path: root/src/backend/functions_makeiso.sh
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-11-04 06:12:14 +0000
committerV3n3RiX <venerix@redcorelinux.org>2017-11-04 06:12:14 +0000
commit8fbf0baee6a6b82876d43cef4abc34d021252d25 (patch)
tree23103fd1ff0aae03ab20229a035573c1df16a5fa /src/backend/functions_makeiso.sh
parent8d25c02e51386bb0f463349e85400df9e07d94a7 (diff)
add Makefilev1.1710
Diffstat (limited to 'src/backend/functions_makeiso.sh')
-rw-r--r--src/backend/functions_makeiso.sh156
1 files changed, 0 insertions, 156 deletions
diff --git a/src/backend/functions_makeiso.sh b/src/backend/functions_makeiso.sh
deleted file mode 100644
index be5a550..0000000
--- a/src/backend/functions_makeiso.sh
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env bash
-
-jailisomnt () {
- mount -o bind packages "$jailsynctarget"/var/cache/packages
- mount -t proc proc "$jailsynctarget"/proc
- mount -t sysfs sysfs "$jailsynctarget"/sys
- mount -t devtmpfs -o relatime,size=3055348k,nr_inodes=763837,mode=755 none "$jailsynctarget"/dev
- mount -t devpts -o nosuid,noexec,relatime,gid=5,mode=620 none "$jailsynctarget"/dev/pts
- mount -t tmpfs -o nosuid,nodev none "$jailsynctarget"/dev/shm
- mount -t tmpfs -o nosuid,nodev,noexec none "$jailsynctarget"/tmp
-}
-
-jailisodmnt () {
- umount -l "$jailsynctarget"/proc > /dev/null 2>&1
- umount -l "$jailsynctarget"/sys > /dev/null 2>&1
- umount -l "$jailsynctarget"/dev/pts > /dev/null 2>&1
- umount -l "$jailsynctarget"/dev/shm > /dev/null 2>&1
- umount -l "$jailsynctarget"/dev > /dev/null 2>&1
- umount -l "$jailsynctarget"/tmp > /dev/null 2>&1
- umount -l "$jailsynctarget"/var/cache/packages > /dev/null 2>&1
-}
-
-jailisobinmode () {
- chroot "$jailsynctarget" su - "$jailuser" -c "$jailbinmodecmd"
-}
-
-jailisomkramfs () {
- chroot "$jailsynctarget" su - "$jailuser" -c "$jaildracutcmd"
-}
-
-jailisomkefi () {
- chroot "$jailsynctarget" su - "$jailuser" -c "$jailmkx64eficmd"
- chroot "$jailsynctarget" su - "$jailuser" -c "$jailmkia32eficmd"
-}
-
-jailisomkchload () {
- chroot "$jailsynctarget" su - "$jailuser" -c "$jailmkchainloadercmd"
-}
-
-jailisoenserv () {
- chroot "$jailsynctarget" su - "$jailuser" -c "rc-update add redcorelive boot"
- for service in acpid dbus NetworkManager avahi-daemon syslog-ng cupsd cronie cgmanager consolekit alsasound bluetooth ntpd openrc-settingsd xdm virtualbox-guest-additions ; do
- chroot "$jailsynctarget" su - "$jailuser" -c "rc-update add "$service" default"
- done
-}
-
-jailisomkdkms () {
- chroot "$jailsynctarget" su - "$jailuser" -c "$jaildkmscmd"
-}
-
-jailisostart () {
- einfo "Oh no, I'm in jail!"
- chroot "$jailsynctarget" su - "$jailuser"
-}
-
-mkliveimg () {
- # create live filesystem image layout
- mkdir -p "$jailsynctarget"
- truncate -s 10G ""$jailsynctarget".img"
- sync
- mkfs.ext2 -F ""$jailsynctarget".img"
- mkdir -p "$jailsyncsource"
- mkdir -p "$jaildvdpath"
- mkdir -p "$jailsquashfspath"
- mkdir -p "$jailrealfspath"
- mkdir -p "$jailbootldrpath"
- mkdir -p "$jailefildrpath"
- sync
- # mount "stage4" image and sync live filesystem image core components
- mount -t squashfs "$jailx64" "$jailsyncsource"
- mount -t ext4 ""$jailsynctarget".img" "$jailsynctarget"
- rsync -aHAXr --progress "$jailsyncsource/" "$jailsynctarget/"
- sync
- # umount "stage4" image
- umount "$jailsyncsource"
- # copy live kernel image
- cp -avx ""$jailsynctarget"/boot/"$jailkernname"" ""$jailrootpath"/boot/vmlinuz"
- # create and copy live initramfs
- jailisomnt
- jailisomkramfs
- jailisodmnt
- mv ""$jailsynctarget"/boot/"$jailramfsname"" ""$jailrootpath"/boot/initrd"
- sync
- # create and copy EFI loader
- jailisomnt
- jailisomkefi
- jailisodmnt
- mv ""$jailsynctarget"/root/bootx64.efi" "$jailefildrpath"
- mv ""$jailsynctarget"/root/bootia32.efi" "$jailefildrpath"
- chmod 755 ""$jailefildrpath"/bootx64.efi"
- chmod 755 ""$jailefildrpath"/bootia32.efi"
- sync
- # create and copy syslinux -> grub chainloader for Unetbootin compatibility
- jailisomnt
- jailisomkchload
- jailisodmnt
- mv ""$jailsynctarget"/root/core.img" "$jailbootldrpath"
- cp -avx ""$jailsynctarget"/usr/lib64/grub/i386-pc/lnxboot.img" "$jailbootldrpath"
- sync
- # chroot into live filesystem image
- jailisomnt
- jailisobinmode
- jailisostart
- jailisodmnt
- sync
- # compile and install DKMS modules, if any
- jailisomnt
- jailisomkdkms
- jailisodmnt
- sync
- # enable live services
- jailisomnt
- jailisoenserv
- jailisodmnt
- sync
- # unmount live filesystem image
- umount -l "$jailsynctarget" > /dev/null 2>&1
- # move live filesystem image where it should be
- mv ""$jailsynctarget".img" "$jailrealfspath"
- sync
- # compress live filesystem image
- mksquashfs "$jaildvdpath" ""$jailrootpath"/squashfs.img" -b 1048576 -comp xz -Xdict-size 100%
- sync
- # move compressed live filesystem image where it should be
- mv ""$jailrootpath/"squashfs.img" "$jailsquashfspath"
- sync
-}
-
-cfgbootldr () {
- # fetch and install GRUB2 config files
- git clone https://gitlab.com/"$distname"/boot-core.git "$jailbootldrdlpath"
- cp -avx "$jailbootldrcfgpath" "$jailrootpath"
- sync
-}
-
-mkclean () {
- # clean temporary resources
- rm -rf "$jailsyncsource"
- rm -rf "$jailsynctarget"
- rm -rf "$jaildvdpath"
- rm -rf "$jailbootldrdlpath"
-}
-
-mkisoimg () {
- # create the actual iso image
- grub2-mkrescue -o ""$jailrootpath".iso" "$jailrootpath"
-}
-
-makeiso () {
- checkifroot
- checkjailsum
- mkliveimg
- cfgbootldr
- mkclean
- mkisoimg
-}