gitlab-ci

This commit is contained in:
wt
2024-09-12 17:06:36 +07:00
parent 51c05f855a
commit 808af99905
7 changed files with 50 additions and 50 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
#------------- grub rescue ---------------------------
grub_rescue() {
grub-mkrescue -o $build/simplelinux.iso $rootfspath &>> $fulllogfile >> $(tty)
grub-mkrescue -o $build/simplelinux.iso $rootfspath &>> $fulllogfile
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 >> $(tty)
tar -czvf $out/simplelinux-$version-rootfs.tar.gz . &>> $fulllogfile
check $? "Build rootfs archive"
}
#-----------------------------------------------------
+2 -2
View File
@@ -29,8 +29,8 @@
check_root
#--------------------------------------
mkdir $out &>> $fulllogfile >> $(tty)
mkdir $root/.log &>> $fulllogfile >> $(tty)
mkdir $out &>> $fulllogfile
mkdir $root/.log &>> $fulllogfile
#--------- import Download sources funcs ------
. ./scripts/download.sh
+9 -9
View File
@@ -10,7 +10,7 @@
#------------------ Building busybox for initramfs ----------------
busybox_initramfs() {
printf "$UGREEN** Building busybox for initramfs\n$RESET"
rm -r $build/busybox &>> $fulllogfile >> $(tty)
rm -r $build/busybox &>> $fulllogfile
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 >> $(tty)
make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- oldconfig &>> $fulllogfile
check $? "Configure busybox all logs in .log"
printf "$UGREEN** Building busybox\n$RESET"
make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- $makeflags &>> $fulllogfile >> $(tty)
make CROSS_COMPILE=x86_64-buildroot-linux-uclibc- $makeflags &>> $fulllogfile
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 >> $(tty)
mkdir -v $build/busybox &>> $fulllogfile >> $(tty)
rm -rv $build/busybox &>> $fulllogfile
mkdir -v $build/busybox &>> $fulllogfile
cd $build/busybox
tar -xvjf $root/downloads/busybox-1.36.1.tar.bz2 &>> $fulllogfile >> $(tty)
tar -xvjf $root/downloads/busybox-1.36.1.tar.bz2 &>> $fulllogfile
cd busybox-1.36.1
cp -v $root/busybox/busybox-rootfs-config .config &>> $fulllogfile >> $(tty)
cp -v $root/busybox/busybox-rootfs-config .config &>> $fulllogfile
printf "$UGREEN** Configuring busybox\n$RESET"
make oldconfig &>> $fulllogfile >> $(tty)
make oldconfig &>> $fulllogfile
check $? "Configure busybox all logs in .log"
printf "$UGREEN** Building busybox\n$RESET"
make $makeflags &>> $fulllogfile >> $(tty)
make $makeflags &>> $fulllogfile
check $? "Build busybox all logs in .log"
}
#--------------------------------------------------
+3 -3
View File
@@ -3,11 +3,11 @@
#---------- Cleaning build and out directory ---------
clean() {
printf "$UGREEN** Cleaning build and out directories\n$RESET"
rm -rv $root/.log/* &>> $fulllogfile >> $(tty)
rm -rv $root/.log/* &>> $fulllogfile
mkdir -p $root/.log
rm -rv $out &>> $fulllogfile >> $(tty)
rm -rv $out &>> $fulllogfile
mkdir -p $out
rm -rv $build &>> $fulllogfile >> $(tty)
rm -rv $build &>> $fulllogfile
mkdir -p $build
printf "$UGREEN** SUCCESS: Cleaning build and out directories\n$RESET"
} # clean
+7 -7
View File
@@ -3,9 +3,9 @@
#------------ glibc ----------------------------------------
glibc() {
printf "$UGREEN** Building glibc\n$RESET"
mkdir -p $build/glibc &>> $fulllogfile >> $(tty)
mkdir -p $build/glibc &>> $fulllogfile
cd $build/glibc
tar -xvf $root/downloads/glibc-2.39.tar.xz &>> $fulllogfile >> $(tty)
tar -xvf $root/downloads/glibc-2.39.tar.xz &>> $fulllogfile
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 >> $(tty)
libc_cv_slibdir=/usr/lib &>> $fulllogfile
check $? "Configure glibc"
make $makeflags &>> $fulllogfile >> $(tty)
make $makeflags &>> $fulllogfile
check $? "Build glibc"
make DESTDIR=$rootfspath install &>> $fulllogfile >> $(tty)
make DESTDIR=$rootfspath install &>> $fulllogfile
check $? "Install glibc to rootfs"
cd $rootfspath
find -name \*.a -delete &>> $fulllogfile >> $(tty)
strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* &>> $fulllogfile >> $(tty)
find -name \*.a -delete &>> $fulllogfile
strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* &>> $fulllogfile
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"
+11 -11
View File
@@ -3,20 +3,20 @@
#--------------- Building Linux Kernel ---------------------
kernel() {
printf "$UGREEN** Building Linux Kernel\n$RESET"
rm -r $build/kernel &>> $fulllogfile >> $(tty)
mkdir -p $build/kernel &>> $fulllogfile >> $(tty)
rm -r $build/kernel &>> $fulllogfile
mkdir -p $build/kernel &>> $fulllogfile
cd $build/kernel
printf "$UGREEN** Extracting Linux Kernel\n$RESET"
tar -xvf $root/downloads/linux-6.7.4.tar.xz &>> $fulllogfile >> $(tty)
tar -xvf $root/downloads/linux-6.7.4.tar.xz &>> $fulllogfile
check $? "Extract Linux Kernel"
cd linux-6.7.4
printf "$UGREEN** Configuring Linux Kernel\n$RESET"
make mrproper &>> $fulllogfile >> $(tty)
cp -v $root/kernel/config-6.7.4 .config &>> $fulllogfile >> $(tty)
make oldconfig &>> $fulllogfile >> $(tty)
make mrproper &>> $fulllogfile
cp -v $root/kernel/config-6.7.4 .config &>> $fulllogfile
make oldconfig &>> $fulllogfile
check $? "Configure Linux Kernel"
printf "$UGREEN** Building Linux Kernel\n$RESET"
make $makeflags &>> $fulllogfile >> $(tty)
make $makeflags &>> $fulllogfile
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 >> $(tty)
make modules &>> fulllogfile
check $? "Build Linux Kernel modules"
printf "$UGREEN** Installing Linux Kernel modules into rootfs path\n$RESET"
mkdir -pv $rootfspath/usr/lib &>> fulllogfile >> $(tty)
mkdir -pv $rootfspath/usr/lib &>> fulllogfile
cd $rootfspath
ln -sv usr/lib lib &>> $fulllogfile >> $(tty)
ln -sv usr/lib lib &>> $fulllogfile
cd $root/build/kernel/linux-6.7.4
make INSTALL_MOD_PATH=$rootfspath modules_install &>> $fulllogfile >> $(tty)
make INSTALL_MOD_PATH=$rootfspath modules_install &>> $fulllogfile
check $? "Install Linux Kernel modules"
} # kernel_modules
#-----------------------------------------------------------
+16 -16
View File
@@ -3,34 +3,34 @@
#----------- Building rootfs ----------------------
rootfs() {
printf "$UGREEN** Building rootfs\n$RESET"
rm -rv $rootfspath &>> $fulllogfile >> $(tty)
mkdir -pv $rootfspath &>> $fulllogfile >> $(tty)
rm -rv $rootfspath &>> $fulllogfile
mkdir -pv $rootfspath &>> $fulllogfile
cd $rootfspath
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)
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
cd usr
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)
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
cd ..
ln -sv /proc/mounts etc/mtab &>> $fulllogfile >> $(tty)
ln -sv /proc/mounts etc/mtab &>> $fulllogfile
busybox rootfs
cp -v $build/busybox/busybox-1.36.1/busybox $rootfspath/usr/bin &>> $fulllogfile >> $(tty)
cp -v $build/busybox/busybox-1.36.1/busybox $rootfspath/usr/bin &>> $fulllogfile
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 >> $(tty)
cp -v $root/build/kernel/linux-6.7.4/arch/x86/boot/bzImage $rootfspath/boot/vmlinuz-linux &>> $fulllogfile
kernel_modules
initramfs
cp -v $root/build/initramfs.img $rootfspath/boot/ &>> $fulllogfile >> $(tty)
cp -v $root/build/initramfs.img $rootfspath/boot/ &>> $fulllogfile
chmod 640 $rootfspath/etc/shadow $rootfspath/etc/inittab
chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script