gitlab-ci
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#------------- grub rescue ---------------------------
|
#------------- grub rescue ---------------------------
|
||||||
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"
|
check $? "Build grub-rescue"
|
||||||
cp -v $build/simplelinux.iso $out/ &>> $fulllogfile
|
cp -v $build/simplelinux.iso $out/ &>> $fulllogfile
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ grub_rescue() {
|
|||||||
#------------------ rootfs archive -------------------
|
#------------------ rootfs archive -------------------
|
||||||
rootfs_archive() {
|
rootfs_archive() {
|
||||||
cd $rootfspath
|
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"
|
check $? "Build rootfs archive"
|
||||||
}
|
}
|
||||||
#-----------------------------------------------------
|
#-----------------------------------------------------
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
check_root
|
check_root
|
||||||
#--------------------------------------
|
#--------------------------------------
|
||||||
|
|
||||||
mkdir $out &>> $fulllogfile >> $(tty)
|
mkdir $out &>> $fulllogfile
|
||||||
mkdir $root/.log &>> $fulllogfile >> $(tty)
|
mkdir $root/.log &>> $fulllogfile
|
||||||
|
|
||||||
#--------- import Download sources funcs ------
|
#--------- import Download sources funcs ------
|
||||||
. ./scripts/download.sh
|
. ./scripts/download.sh
|
||||||
|
|||||||
+9
-9
@@ -10,7 +10,7 @@
|
|||||||
#------------------ Building busybox for initramfs ----------------
|
#------------------ Building busybox for initramfs ----------------
|
||||||
busybox_initramfs() {
|
busybox_initramfs() {
|
||||||
printf "$UGREEN** Building busybox for initramfs\n$RESET"
|
printf "$UGREEN** Building busybox for initramfs\n$RESET"
|
||||||
rm -r $build/busybox &>> $fulllogfile >> $(tty)
|
rm -r $build/busybox &>> $fulllogfile
|
||||||
mkdir -p $build/busybox
|
mkdir -p $build/busybox
|
||||||
cd $build/busybox
|
cd $build/busybox
|
||||||
tar -xjf $root/downloads/busybox-1.36.1.tar.bz2
|
tar -xjf $root/downloads/busybox-1.36.1.tar.bz2
|
||||||
@@ -19,10 +19,10 @@ busybox_initramfs() {
|
|||||||
cp $root/busybox/busybox-initramfs-config .config
|
cp $root/busybox/busybox-initramfs-config .config
|
||||||
export PATH=$PATH:/opt/toolchains/x86_64-buildroot-linux-uclibc-gcc/bin
|
export PATH=$PATH:/opt/toolchains/x86_64-buildroot-linux-uclibc-gcc/bin
|
||||||
printf "$UGREEN** Configuring busybox\n$RESET"
|
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"
|
check $? "Configure busybox all logs in .log"
|
||||||
printf "$UGREEN** Building busybox\n$RESET"
|
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"
|
check $? "Build busybox all logs in .log"
|
||||||
}
|
}
|
||||||
#------------------------------------------------------------------
|
#------------------------------------------------------------------
|
||||||
@@ -30,17 +30,17 @@ busybox_initramfs() {
|
|||||||
#----------- Building busybox for rootfs ----------
|
#----------- Building busybox for rootfs ----------
|
||||||
busybox_rootfs() {
|
busybox_rootfs() {
|
||||||
printf "$UGREEN** Building busybox for rootfs\n$RESET"
|
printf "$UGREEN** Building busybox for rootfs\n$RESET"
|
||||||
rm -rv $build/busybox &>> $fulllogfile >> $(tty)
|
rm -rv $build/busybox &>> $fulllogfile
|
||||||
mkdir -v $build/busybox &>> $fulllogfile >> $(tty)
|
mkdir -v $build/busybox &>> $fulllogfile
|
||||||
cd $build/busybox
|
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
|
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"
|
printf "$UGREEN** Configuring busybox\n$RESET"
|
||||||
make oldconfig &>> $fulllogfile >> $(tty)
|
make oldconfig &>> $fulllogfile
|
||||||
check $? "Configure busybox all logs in .log"
|
check $? "Configure busybox all logs in .log"
|
||||||
printf "$UGREEN** Building busybox\n$RESET"
|
printf "$UGREEN** Building busybox\n$RESET"
|
||||||
make $makeflags &>> $fulllogfile >> $(tty)
|
make $makeflags &>> $fulllogfile
|
||||||
check $? "Build busybox all logs in .log"
|
check $? "Build busybox all logs in .log"
|
||||||
}
|
}
|
||||||
#--------------------------------------------------
|
#--------------------------------------------------
|
||||||
|
|||||||
+3
-3
@@ -3,11 +3,11 @@
|
|||||||
#---------- Cleaning build and out directory ---------
|
#---------- Cleaning build and out directory ---------
|
||||||
clean() {
|
clean() {
|
||||||
printf "$UGREEN** Cleaning build and out directories\n$RESET"
|
printf "$UGREEN** Cleaning build and out directories\n$RESET"
|
||||||
rm -rv $root/.log/* &>> $fulllogfile >> $(tty)
|
rm -rv $root/.log/* &>> $fulllogfile
|
||||||
mkdir -p $root/.log
|
mkdir -p $root/.log
|
||||||
rm -rv $out &>> $fulllogfile >> $(tty)
|
rm -rv $out &>> $fulllogfile
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
rm -rv $build &>> $fulllogfile >> $(tty)
|
rm -rv $build &>> $fulllogfile
|
||||||
mkdir -p $build
|
mkdir -p $build
|
||||||
printf "$UGREEN** SUCCESS: Cleaning build and out directories\n$RESET"
|
printf "$UGREEN** SUCCESS: Cleaning build and out directories\n$RESET"
|
||||||
} # clean
|
} # clean
|
||||||
|
|||||||
+7
-7
@@ -3,9 +3,9 @@
|
|||||||
#------------ glibc ----------------------------------------
|
#------------ glibc ----------------------------------------
|
||||||
glibc() {
|
glibc() {
|
||||||
printf "$UGREEN** Building glibc\n$RESET"
|
printf "$UGREEN** Building glibc\n$RESET"
|
||||||
mkdir -p $build/glibc &>> $fulllogfile >> $(tty)
|
mkdir -p $build/glibc &>> $fulllogfile
|
||||||
cd $build/glibc
|
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"
|
check $? "Extract glibc"
|
||||||
cd glibc-2.39
|
cd glibc-2.39
|
||||||
mkdir build
|
mkdir build
|
||||||
@@ -17,15 +17,15 @@ glibc() {
|
|||||||
--enable-kernel=4.19 \
|
--enable-kernel=4.19 \
|
||||||
--enable-stack-protector=strong \
|
--enable-stack-protector=strong \
|
||||||
--disable-nscd \
|
--disable-nscd \
|
||||||
libc_cv_slibdir=/usr/lib &>> $fulllogfile >> $(tty)
|
libc_cv_slibdir=/usr/lib &>> $fulllogfile
|
||||||
check $? "Configure glibc"
|
check $? "Configure glibc"
|
||||||
make $makeflags &>> $fulllogfile >> $(tty)
|
make $makeflags &>> $fulllogfile
|
||||||
check $? "Build glibc"
|
check $? "Build glibc"
|
||||||
make DESTDIR=$rootfspath install &>> $fulllogfile >> $(tty)
|
make DESTDIR=$rootfspath install &>> $fulllogfile
|
||||||
check $? "Install glibc to rootfs"
|
check $? "Install glibc to rootfs"
|
||||||
cd $rootfspath
|
cd $rootfspath
|
||||||
find -name \*.a -delete &>> $fulllogfile >> $(tty)
|
find -name \*.a -delete &>> $fulllogfile
|
||||||
strip --strip-unneeded $rootfspath/usr/lib/* $rootfspath/usr/bin/* &>> $fulllogfile >> $(tty)
|
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;"
|
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
|
cd $root
|
||||||
check $? "Build and install glibc"
|
check $? "Build and install glibc"
|
||||||
|
|||||||
+11
-11
@@ -3,20 +3,20 @@
|
|||||||
#--------------- Building Linux Kernel ---------------------
|
#--------------- Building Linux Kernel ---------------------
|
||||||
kernel() {
|
kernel() {
|
||||||
printf "$UGREEN** Building Linux Kernel\n$RESET"
|
printf "$UGREEN** Building Linux Kernel\n$RESET"
|
||||||
rm -r $build/kernel &>> $fulllogfile >> $(tty)
|
rm -r $build/kernel &>> $fulllogfile
|
||||||
mkdir -p $build/kernel &>> $fulllogfile >> $(tty)
|
mkdir -p $build/kernel &>> $fulllogfile
|
||||||
cd $build/kernel
|
cd $build/kernel
|
||||||
printf "$UGREEN** Extracting Linux Kernel\n$RESET"
|
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"
|
check $? "Extract Linux Kernel"
|
||||||
cd linux-6.7.4
|
cd linux-6.7.4
|
||||||
printf "$UGREEN** Configuring Linux Kernel\n$RESET"
|
printf "$UGREEN** Configuring Linux Kernel\n$RESET"
|
||||||
make mrproper &>> $fulllogfile >> $(tty)
|
make mrproper &>> $fulllogfile
|
||||||
cp -v $root/kernel/config-6.7.4 .config &>> $fulllogfile >> $(tty)
|
cp -v $root/kernel/config-6.7.4 .config &>> $fulllogfile
|
||||||
make oldconfig &>> $fulllogfile >> $(tty)
|
make oldconfig &>> $fulllogfile
|
||||||
check $? "Configure Linux Kernel"
|
check $? "Configure Linux Kernel"
|
||||||
printf "$UGREEN** Building Linux Kernel\n$RESET"
|
printf "$UGREEN** Building Linux Kernel\n$RESET"
|
||||||
make $makeflags &>> $fulllogfile >> $(tty)
|
make $makeflags &>> $fulllogfile
|
||||||
check $? "Build Linux Kernel"
|
check $? "Build Linux Kernel"
|
||||||
ls -lh arch/x86/boot/bzImage
|
ls -lh arch/x86/boot/bzImage
|
||||||
} # kernel
|
} # kernel
|
||||||
@@ -26,14 +26,14 @@ kernel() {
|
|||||||
kernel_modules() {
|
kernel_modules() {
|
||||||
printf "$UGREEN** Building Linux Kernel modules\n$RESET"
|
printf "$UGREEN** Building Linux Kernel modules\n$RESET"
|
||||||
cd $build/kernel/linux-6.7.4
|
cd $build/kernel/linux-6.7.4
|
||||||
make modules &>> fulllogfile >> $(tty)
|
make modules &>> fulllogfile
|
||||||
check $? "Build Linux Kernel modules"
|
check $? "Build Linux Kernel modules"
|
||||||
printf "$UGREEN** Installing Linux Kernel modules into rootfs path\n$RESET"
|
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
|
cd $rootfspath
|
||||||
ln -sv usr/lib lib &>> $fulllogfile >> $(tty)
|
ln -sv usr/lib lib &>> $fulllogfile
|
||||||
cd $root/build/kernel/linux-6.7.4
|
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"
|
check $? "Install Linux Kernel modules"
|
||||||
} # kernel_modules
|
} # kernel_modules
|
||||||
#-----------------------------------------------------------
|
#-----------------------------------------------------------
|
||||||
|
|||||||
+16
-16
@@ -3,34 +3,34 @@
|
|||||||
#----------- Building rootfs ----------------------
|
#----------- Building rootfs ----------------------
|
||||||
rootfs() {
|
rootfs() {
|
||||||
printf "$UGREEN** Building rootfs\n$RESET"
|
printf "$UGREEN** Building rootfs\n$RESET"
|
||||||
rm -rv $rootfspath &>> $fulllogfile >> $(tty)
|
rm -rv $rootfspath &>> $fulllogfile
|
||||||
mkdir -pv $rootfspath &>> $fulllogfile >> $(tty)
|
mkdir -pv $rootfspath &>> $fulllogfile
|
||||||
cd $rootfspath
|
cd $rootfspath
|
||||||
mkdir -pv $(cat $rootfsfile) &>> $fulllogfile >> $(tty)
|
mkdir -pv $(cat $rootfsfile) &>> $fulllogfile
|
||||||
ln -sv usr/lib lib &>> $fulllogfile >> $(tty)
|
ln -sv usr/lib lib &>> $fulllogfile
|
||||||
ln -sv usr/lib lib64 &>> $fulllogfile >> $(tty)
|
ln -sv usr/lib lib64 &>> $fulllogfile
|
||||||
ln -sv usr/bin bin &>> $fulllogfile >> $(tty)
|
ln -sv usr/bin bin &>> $fulllogfile
|
||||||
ln -sv usr/bin sbin &>> $fulllogfile >> $(tty)
|
ln -sv usr/bin sbin &>> $fulllogfile
|
||||||
cd usr
|
cd usr
|
||||||
ln -sv bin sbin &>> $fulllogfile >> $(tty)
|
ln -sv bin sbin &>> $fulllogfile
|
||||||
ln -sv lib lib64 &>> $fulllogfile >> $(tty)
|
ln -sv lib lib64 &>> $fulllogfile
|
||||||
cp -rv $root/rootfs/etc/* $rootfspath/etc/ &>> $fulllogfile >> $(tty)
|
cp -rv $root/rootfs/etc/* $rootfspath/etc/ &>> $fulllogfile
|
||||||
cp -rv $root/rootfs/usr/* $rootfspath/usr/ &>> $fulllogfile >> $(tty)
|
cp -rv $root/rootfs/usr/* $rootfspath/usr/ &>> $fulllogfile
|
||||||
cp -rv $root/rootfs/boot/* $rootfspath/boot/ &>> $fulllogfile >> $(tty)
|
cp -rv $root/rootfs/boot/* $rootfspath/boot/ &>> $fulllogfile
|
||||||
cd ..
|
cd ..
|
||||||
ln -sv /proc/mounts etc/mtab &>> $fulllogfile >> $(tty)
|
ln -sv /proc/mounts etc/mtab &>> $fulllogfile
|
||||||
|
|
||||||
busybox rootfs
|
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
|
cd $rootfspath/usr/bin
|
||||||
for i in $(./busybox --list); do ln -s busybox $i; done
|
for i in $(./busybox --list); do ln -s busybox $i; done
|
||||||
|
|
||||||
glibc
|
glibc
|
||||||
kernel
|
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
|
kernel_modules
|
||||||
initramfs
|
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 640 $rootfspath/etc/shadow $rootfspath/etc/inittab
|
||||||
chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script
|
chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script
|
||||||
|
|||||||
Reference in New Issue
Block a user