diff --git a/scripts/artifacts.sh b/scripts/artifacts.sh index d4a20d4..414e78c 100644 --- a/scripts/artifacts.sh +++ b/scripts/artifacts.sh @@ -2,7 +2,7 @@ #------------- grub rescue --------------------------- grub_rescue() { - grub-mkrescue -o $build/simplelinux.iso $rootfspath &>> $fulllogfile + grub-mkrescue -o $build/simplelinux.iso $rootfspath &>> $fulllogfile >> $(tty) check $? "Build grub-rescue" cp -v $build/simplelinux.iso $out/ &>> $fulllogfile } @@ -11,7 +11,7 @@ grub_rescue() { #------------------ rootfs archive ------------------- rootfs_archive() { cd $rootfspath - tar -czvf $out/simplelinux-$version-rootfs.tar.gz . &>> $fulllogfile + tar -czvf $out/simplelinux-$version-rootfs.tar.gz . &>> $fulllogfile >> $(tty) check $? "Build rootfs archive" } #----------------------------------------------------- diff --git a/scripts/build_image.sh b/scripts/build_image.sh index 5b2372d..3b5aa93 100755 --- a/scripts/build_image.sh +++ b/scripts/build_image.sh @@ -29,8 +29,8 @@ check_root #-------------------------------------- -mkdir $out &>> $fulllogfile -mkdir $root/.log &>> $fulllogfile +mkdir $out &>> $fulllogfile >> $(tty) +mkdir $root/.log &>> $fulllogfile >> $(tty) #--------- import Download sources funcs ------ . ./scripts/download.sh diff --git a/scripts/busybox.sh b/scripts/busybox.sh index 572fa0d..3a2739c 100644 --- a/scripts/busybox.sh +++ b/scripts/busybox.sh @@ -10,7 +10,7 @@ #------------------ Building busybox for initramfs ---------------- busybox_initramfs() { printf "$UGREEN** Building busybox for initramfs\n$RESET" - rm -r $build/busybox &>> $fulllogfile + rm -r $build/busybox &>> $fulllogfile >> $(tty) mkdir -p $build/busybox cd $build/busybox tar -xjf $root/downloads/busybox-1.36.1.tar.bz2 @@ -19,10 +19,10 @@ busybox_initramfs() { cp $root/busybox/busybox-initramfs-config .config export PATH=$PATH:/opt/toolchains/x86_64-buildroot-linux-uclibc-gcc/bin printf "$UGREEN** Configuring busybox\n$RESET" - make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- oldconfig &>> $fulllogfile + make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- oldconfig &>> $fulllogfile >> $(tty) check $? "Configure busybox all logs in .log" printf "$UGREEN** Building busybox\n$RESET" - make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- $makeflags &>> $fulllogfile + make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- $makeflags &>> $fulllogfile >> $(tty) check $? "Build busybox all logs in .log" } #------------------------------------------------------------------ @@ -30,17 +30,17 @@ busybox_initramfs() { #----------- Building busybox for rootfs ---------- busybox_rootfs() { printf "$UGREEN** Building busybox for rootfs\n$RESET" - rm -rv $build/busybox &>> $fulllogfile - mkdir -v $build/busybox &>> $fulllogfile + rm -rv $build/busybox &>> $fulllogfile >> $(tty) + mkdir -v $build/busybox &>> $fulllogfile >> $(tty) cd $build/busybox - tar -xvjf $root/downloads/busybox-1.36.1.tar.bz2 &>> $fulllogfile + tar -xvjf $root/downloads/busybox-1.36.1.tar.bz2 &>> $fulllogfile >> $(tty) cd busybox-1.36.1 - cp -v $root/busybox/busybox-rootfs-config .config &>> $fulllogfile + cp -v $root/busybox/busybox-rootfs-config .config &>> $fulllogfile >> $(tty) printf "$UGREEN** Configuring busybox\n$RESET" - make oldconfig &>> $fulllogfile + make oldconfig &>> $fulllogfile >> $(tty) check $? "Configure busybox all logs in .log" printf "$UGREEN** Building busybox\n$RESET" - make $makeflags &>> $fulllogfile + make $makeflags &>> $fulllogfile >> $(tty) check $? "Build busybox all logs in .log" } #-------------------------------------------------- diff --git a/scripts/clean.sh b/scripts/clean.sh index 7749dcc..fa5f7ac 100644 --- a/scripts/clean.sh +++ b/scripts/clean.sh @@ -3,11 +3,11 @@ #---------- Cleaning build and out directory --------- clean() { printf "$UGREEN** Cleaning build and out directories\n$RESET" - rm -rv $root/.log/* &>> $fulllogfile + rm -rv $root/.log/* &>> $fulllogfile >> $(tty) mkdir -p $root/.log - rm -rv $out &>> $fulllogfile + rm -rv $out &>> $fulllogfile >> $(tty) mkdir -p $out - rm -rv $build &>> $fulllogfile + rm -rv $build &>> $fulllogfile >> $(tty) mkdir -p $build printf "$UGREEN** SUCCESS: Cleaning build and out directories\n$RESET" } # clean diff --git a/scripts/glibc.sh b/scripts/glibc.sh index 5aa4117..23ed7fe 100644 --- a/scripts/glibc.sh +++ b/scripts/glibc.sh @@ -3,9 +3,9 @@ #------------ glibc ---------------------------------------- glibc() { printf "$UGREEN** Building glibc\n$RESET" - mkdir -p $build/glibc &>> $fulllogfile + mkdir -p $build/glibc &>> $fulllogfile >> $(tty) cd $build/glibc - tar -xvf $root/downloads/glibc-2.39.tar.xz &>> $fulllogfile + tar -xvf $root/downloads/glibc-2.39.tar.xz &>> $fulllogfile >> $(tty) check $? "Extract glibc" cd glibc-2.39 mkdir build @@ -17,15 +17,15 @@ glibc() { --enable-kernel=4.19 \ --enable-stack-protector=strong \ --disable-nscd \ - libc_cv_slibdir=/usr/lib &>> $fulllogfile + libc_cv_slibdir=/usr/lib &>> $fulllogfile >> $(tty) check $? "Configure glibc" - make $makeflags &>> $fulllogfile + make $makeflags &>> $fulllogfile >> $(tty) check $? "Build glibc" - make DESTDIR=$rootfspath install &>> $fulllogfile + make DESTDIR=$rootfspath install &>> $fulllogfile >> $(tty) check $? "Install glibc to rootfs" cd $rootfspath - find -name \*.a -delete &>> $fulllogfile - strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* &>> $fulllogfile + find -name \*.a -delete &>> $fulllogfile >> $(tty) + strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* &>> $fulllogfile >> $(tty) chroot $rootfspath /bin/sh -c "mkdir -p /usr/lib/locale;localedef -i C -f UTF-8 C.UTF-8;localedef -i en_US -f UTF-8 en_US.UTF-8;localedef -i ru_RU -f UTF-8 ru_RU-UTF-8;" cd $root check $? "Build and install glibc" diff --git a/scripts/initramfs.sh b/scripts/initramfs.sh index 5dc7509..05a0185 100644 --- a/scripts/initramfs.sh +++ b/scripts/initramfs.sh @@ -5,7 +5,7 @@ initramfs() { printf "$UGREEN** Building initramfs\n$RESET" #--------- Creating directories and files ------------------- - rm -r $initramfspath &>> $fulllogfile + rm -r $initramfspath &>> $fulllogfile >> $(tty) mkdir -p $initramfspath cd $initramfspath mkdir -p $(cat $initramfsfile) diff --git a/scripts/kernel.sh b/scripts/kernel.sh index 3d073de..7a2f38f 100644 --- a/scripts/kernel.sh +++ b/scripts/kernel.sh @@ -3,20 +3,20 @@ #--------------- Building Linux Kernel --------------------- kernel() { printf "$UGREEN** Building Linux Kernel\n$RESET" - rm -r $build/kernel &>> $fulllogfile - mkdir -p $build/kernel &>> $fulllogfile + rm -r $build/kernel &>> $fulllogfile >> $(tty) + mkdir -p $build/kernel &>> $fulllogfile >> $(tty) cd $build/kernel printf "$UGREEN** Extracting Linux Kernel\n$RESET" - tar -xvf $root/downloads/linux-6.7.4.tar.xz &>> $fulllogfile + tar -xvf $root/downloads/linux-6.7.4.tar.xz &>> $fulllogfile >> $(tty) check $? "Extract Linux Kernel" cd linux-6.7.4 printf "$UGREEN** Configuring Linux Kernel\n$RESET" - make mrproper &>> $fulllogfile - cp -v $root/kernel/config-6.7.4 .config &>> $fulllogfile - make oldconfig &>> $fulllogfile + make mrproper &>> $fulllogfile >> $(tty) + cp -v $root/kernel/config-6.7.4 .config &>> $fulllogfile >> $(tty) + make oldconfig &>> $fulllogfile >> $(tty) check $? "Configure Linux Kernel" printf "$UGREEN** Building Linux Kernel\n$RESET" - make $makeflags &>> $fulllogfile + make $makeflags &>> $fulllogfile >> $(tty) check $? "Build Linux Kernel" ls -lh arch/x86/boot/bzImage } # kernel @@ -26,14 +26,14 @@ kernel() { kernel_modules() { printf "$UGREEN** Building Linux Kernel modules\n$RESET" cd $build/kernel/linux-6.7.4 - make modules &>> fulllogfile + make modules &>> fulllogfile >> $(tty) check $? "Build Linux Kernel modules" printf "$UGREEN** Installing Linux Kernel modules into rootfs path\n$RESET" - mkdir -pv $rootfspath/usr/lib &>> fulllogfile + mkdir -pv $rootfspath/usr/lib &>> fulllogfile >> $(tty) cd $rootfspath - ln -sv usr/lib lib &>> $fulllogfile + ln -sv usr/lib lib &>> $fulllogfile >> $(tty) cd $root/build/kernel/linux-6.7.4 - make INSTALL_MOD_PATH=$rootfspath modules_install &>> $fulllogfile + make INSTALL_MOD_PATH=$rootfspath modules_install &>> $fulllogfile >> $(tty) check $? "Install Linux Kernel modules" } # kernel_modules #----------------------------------------------------------- diff --git a/scripts/rootfs.sh b/scripts/rootfs.sh index c4c3768..1425453 100644 --- a/scripts/rootfs.sh +++ b/scripts/rootfs.sh @@ -3,34 +3,34 @@ #----------- Building rootfs ---------------------- rootfs() { printf "$UGREEN** Building rootfs\n$RESET" - rm -rv $rootfspath &>> $fulllogfile - mkdir -pv $rootfspath &>> $fulllogfile + rm -rv $rootfspath &>> $fulllogfile >> $(tty) + mkdir -pv $rootfspath &>> $fulllogfile >> $(tty) cd $rootfspath - mkdir -pv $(cat $rootfsfile) &>> $fulllogfile - ln -sv usr/lib lib &>> $fulllogfile - ln -sv usr/lib lib64 &>> $fulllogfile - ln -sv usr/bin bin &>> $fulllogfile - ln -sv usr/bin sbin &>> $fulllogfile + mkdir -pv $(cat $rootfsfile) &>> $fulllogfile >> $(tty) + ln -sv usr/lib lib &>> $fulllogfile >> $(tty) + ln -sv usr/lib lib64 &>> $fulllogfile >> $(tty) + ln -sv usr/bin bin &>> $fulllogfile >> $(tty) + ln -sv usr/bin sbin &>> $fulllogfile >> $(tty) cd usr - ln -sv bin sbin &>> $fulllogfile - ln -sv lib lib64 &>> $fulllogfile - cp -rv $root/rootfs/etc/* $rootfspath/etc/ &>> $fulllogfile - cp -rv $root/rootfs/usr/* $rootfspath/usr/ &>> $fulllogfile - cp -rv $root/rootfs/boot/* $rootfspath/boot/ &>> $fulllogfile + ln -sv bin sbin &>> $fulllogfile >> $(tty) + ln -sv lib lib64 &>> $fulllogfile >> $(tty) + cp -rv $root/rootfs/etc/* $rootfspath/etc/ &>> $fulllogfile >> $(tty) + cp -rv $root/rootfs/usr/* $rootfspath/usr/ &>> $fulllogfile >> $(tty) + cp -rv $root/rootfs/boot/* $rootfspath/boot/ &>> $fulllogfile >> $(tty) cd .. - ln -sv /proc/mounts etc/mtab &>> $fulllogfile + ln -sv /proc/mounts etc/mtab &>> $fulllogfile >> $(tty) busybox rootfs - cp -v $build/busybox/busybox-1.36.1/busybox $rootfspath/usr/bin &>> $fulllogfile + cp -v $build/busybox/busybox-1.36.1/busybox $rootfspath/usr/bin &>> $fulllogfile >> $(tty) cd $rootfspath/usr/bin for i in $(./busybox --list); do ln -s busybox $i; done glibc kernel - cp -v $root/build/kernel/linux-6.7.4/arch/x86/boot/bzImage $rootfspath/boot/vmlinuz-linux &>> $fulllogfile + cp -v $root/build/kernel/linux-6.7.4/arch/x86/boot/bzImage $rootfspath/boot/vmlinuz-linux &>> $fulllogfile >> $(tty) kernel_modules initramfs - cp -v $root/build/initramfs.img $rootfspath/boot/ &>> $fulllogfile + cp -v $root/build/initramfs.img $rootfspath/boot/ &>> $fulllogfile >> $(tty) chmod 640 $rootfspath/etc/shadow $rootfspath/etc/inittab chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script