updated for gitea server
This commit is contained in:
1 parent
885f772630
commit
f3518956c6
8 files changed
+167
-7
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./scripts/colors.sh
|
||||||
|
. ./scripts/funcs.sh
|
||||||
|
. ./scripts/config.sh
|
||||||
|
|
||||||
|
bash() {
|
||||||
|
printf "$GREEN** Building and installing bash\n$RESET"
|
||||||
|
mkdir $build/bash
|
||||||
|
cd $build/bash
|
||||||
|
tar -xvf $root/downloads/bash-5.2.32.tar.gz
|
||||||
|
check $? "Extract bash"
|
||||||
|
cd bash-5.2.32
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--host=$CROSS_COMPILE
|
||||||
|
check $? "Configure bash"
|
||||||
|
make $makeflags
|
||||||
|
check $? "Build bash"
|
||||||
|
cp -v bash $rootfspath/usr/bin
|
||||||
|
$CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/bash
|
||||||
|
check $? "Installing to rootfs bash"
|
||||||
|
}
|
||||||
+7
-3
@@ -21,8 +21,12 @@ export makeflags=-j$(nproc) # makeflags
|
|||||||
export CROSS_COMPILE=arm-buildroot-linux-uclibcgnueabihf
|
export CROSS_COMPILE=arm-buildroot-linux-uclibcgnueabihf
|
||||||
export ARCH=arm
|
export ARCH=arm
|
||||||
export sdroot=$out/sdroot
|
export sdroot=$out/sdroot
|
||||||
export ZLIB_ENABLE="true"
|
export ZLIB_ENABLE="false"
|
||||||
export DROPBEAR_ENABLE="true"
|
export DROPBEAR_ENABLE="false"
|
||||||
export image_usable_enable="true"
|
export image_usable_enable="true"
|
||||||
export sftp_server_enable="true"
|
export sftp_server_enable="false"
|
||||||
|
export curl_enable="false"
|
||||||
|
export bash_enable="false"
|
||||||
|
export git_enable="false"
|
||||||
|
export gitea_enable="true"
|
||||||
#--------------------------------------
|
#--------------------------------------
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./scripts/colors.sh
|
||||||
|
. ./scripts/funcs.sh
|
||||||
|
. ./scripts/config.sh
|
||||||
|
. ./scripts/zlib.sh
|
||||||
|
|
||||||
|
curl() {
|
||||||
|
if [ ! -d $build/zlib ]; then
|
||||||
|
zlib
|
||||||
|
fi
|
||||||
|
printf "$GREEN** Building and installing curl\n$RESET"
|
||||||
|
mkdir $build/curl
|
||||||
|
cd $build/curl
|
||||||
|
tar -xvf $root/downloads/curl-8.9.1.tar.xz
|
||||||
|
check $? "Extract curl"
|
||||||
|
cd curl-8.9.1
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--host=$CROSS_COMPILE \
|
||||||
|
--without-ssl \
|
||||||
|
--disable-static \
|
||||||
|
--enable-shared \
|
||||||
|
--with-zlib=$rootfspath
|
||||||
|
check $? "Configure curl"
|
||||||
|
make $makeflags
|
||||||
|
check $? "Build curl"
|
||||||
|
make DESTDIR=$rootfspath install
|
||||||
|
rm \
|
||||||
|
-rv \
|
||||||
|
$rootfspath/usr/include \
|
||||||
|
$rootfspath/usr/share \
|
||||||
|
$rootfspath/usr/lib/*.a \
|
||||||
|
$rootfspath/usr/lib/*.la \
|
||||||
|
$rootfspath/usr/lib/pkgconfig
|
||||||
|
$CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/curl $rootfspath/usr/lib/libcurl.so.4.8.0
|
||||||
|
check $? "Installing to rootfs curl"
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./scripts/colors.sh
|
||||||
|
. ./scripts/funcs.sh
|
||||||
|
. ./scripts/config.sh
|
||||||
|
. ./scripts/curl.sh
|
||||||
|
|
||||||
|
git() {
|
||||||
|
if [ ! -d $build/curl ]; then
|
||||||
|
curl
|
||||||
|
fi
|
||||||
|
printf "$GREEN** Building and installing git\n$RESET"
|
||||||
|
mkdir $build/git
|
||||||
|
cd $build/git
|
||||||
|
tar -xvf $root/downloads/git-2.46.0.tar.xz
|
||||||
|
check $? "Extract git"
|
||||||
|
cd git-2.46.0
|
||||||
|
./configure \
|
||||||
|
--prefix=/usr \
|
||||||
|
--host=$CROSS_COMPILE \
|
||||||
|
NO_ICONV=true \
|
||||||
|
ac_cv_fread_reads_directories=true \
|
||||||
|
ac_cv_snprintf_returns_bogus=false
|
||||||
|
check $? "Configure git"
|
||||||
|
make $makeflags
|
||||||
|
check $? "Build git"
|
||||||
|
make DESTDIR=$rootfspath install
|
||||||
|
$CROSS_COMPILE-strip --strip-unneeded $rootfspath/usr/bin/* $rootfspath/libexec/git-core/*
|
||||||
|
printf "$GREEN** SUCCESS: Building and installing git\n$RESET"
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. ./scripts/colors.sh
|
||||||
|
. ./scripts/funcs.sh
|
||||||
|
. ./scripts/config.sh
|
||||||
|
. ./scripts/zlib.sh
|
||||||
|
. ./scripts/dropbear.sh
|
||||||
|
. ./scripts/sftp_server.sh
|
||||||
|
. ./scripts/curl.sh
|
||||||
|
. ./scripts/bash.sh
|
||||||
|
. ./scripts/git.sh
|
||||||
|
|
||||||
|
gitea() {
|
||||||
|
if [ ! -d $build/zlib ]; then
|
||||||
|
zlib
|
||||||
|
fi
|
||||||
|
if [ ! -d $build/dropbear ]; then
|
||||||
|
dropbear
|
||||||
|
fi
|
||||||
|
if [ ! -d $build/sftp_server ]; then
|
||||||
|
sftp_server
|
||||||
|
fi
|
||||||
|
if [ ! -d $build/curl ]; then
|
||||||
|
curl
|
||||||
|
fi
|
||||||
|
if [ ! -d $build/curl ]; then
|
||||||
|
bash
|
||||||
|
fi
|
||||||
|
if [ ! -d $build/git ]; then
|
||||||
|
git
|
||||||
|
fi
|
||||||
|
cp -v $root/downloads/gitea-1.22.4-linux-arm-5 $rootfspath/usr/bin/gitea
|
||||||
|
chmod +x $rootfspath/usr/bin/gitea
|
||||||
|
check $? "download and install gitea to rootfs"
|
||||||
|
}
|
||||||
@@ -9,6 +9,10 @@
|
|||||||
. ./scripts/zlib.sh
|
. ./scripts/zlib.sh
|
||||||
. ./scripts/dropbear.sh
|
. ./scripts/dropbear.sh
|
||||||
. ./scripts/sftp_server.sh
|
. ./scripts/sftp_server.sh
|
||||||
|
. ./scripts/curl.sh
|
||||||
|
. ./scripts/bash.sh
|
||||||
|
. ./scripts/git.sh
|
||||||
|
. ./scripts/gitea.sh
|
||||||
|
|
||||||
#----------- Building rootfs ----------------------
|
#----------- Building rootfs ----------------------
|
||||||
rootfs() {
|
rootfs() {
|
||||||
@@ -49,6 +53,18 @@ rootfs() {
|
|||||||
if [ "$sftp_server_enable" = "true" ]; then
|
if [ "$sftp_server_enable" = "true" ]; then
|
||||||
sftp_server
|
sftp_server
|
||||||
fi
|
fi
|
||||||
|
if [ "$curl_enable" = "true" ]; then
|
||||||
|
curl
|
||||||
|
fi
|
||||||
|
if [ "$bash_enable" = "true" ]; then
|
||||||
|
bash
|
||||||
|
fi
|
||||||
|
if [ "$git_enable" = "true" ]; then
|
||||||
|
git
|
||||||
|
fi
|
||||||
|
if [ "$gitea_enable" = "true" ]; then
|
||||||
|
gitea
|
||||||
|
fi
|
||||||
|
|
||||||
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 $rootfspath/init
|
chmod 755 $rootfspath/etc/init.d/* $rootfspath/usr/share/udhcpc/default.script $rootfspath/init
|
||||||
|
|||||||
+14
-4
@@ -29,7 +29,7 @@ sdroot() {
|
|||||||
sdrootsize=(${rawsdrootsize// / })
|
sdrootsize=(${rawsdrootsize// / })
|
||||||
echo $sdrootsize
|
echo $sdrootsize
|
||||||
echo $(($sdrootsize+2))
|
echo $(($sdrootsize+2))
|
||||||
dd if=/dev/zero of=rootfs.ext4 bs=1K count=$(($sdrootsize+3000))
|
dd if=/dev/zero of=rootfs.ext4 bs=1K count=$(($sdrootsize+$sdrootsize))
|
||||||
check $? "Write zero rootfs.ext4"
|
check $? "Write zero rootfs.ext4"
|
||||||
mkfs.ext4 rootfs.ext4
|
mkfs.ext4 rootfs.ext4
|
||||||
check $? "Creating ext4 filesystem"
|
check $? "Creating ext4 filesystem"
|
||||||
@@ -66,7 +66,12 @@ sdroot_usable() {
|
|||||||
cp -v $root/extlinux/extlinux_usable.conf $sdroot/boot/extlinux/extlinux.conf
|
cp -v $root/extlinux/extlinux_usable.conf $sdroot/boot/extlinux/extlinux.conf
|
||||||
check $? "Copy extlinux.conf"
|
check $? "Copy extlinux.conf"
|
||||||
# kernel_with_rootfs
|
# kernel_with_rootfs
|
||||||
cp -rv $build/rootfs/* $sdroot/
|
# cp -rv $build/rootfs/* $sdroot/
|
||||||
|
cd $rootfspath
|
||||||
|
tar -czvf /tmp/rootfs.tar.gz.tmp .
|
||||||
|
cd $sdroot
|
||||||
|
tar -xvf /tmp/rootfs.tar.gz.tmp
|
||||||
|
|
||||||
initramfs
|
initramfs
|
||||||
cp -v $build/initramfs.img $sdroot/boot
|
cp -v $build/initramfs.img $sdroot/boot
|
||||||
cp -v $build/kernel/linux-6.1.91/arch/$ARCH/boot/zImage $sdroot/boot
|
cp -v $build/kernel/linux-6.1.91/arch/$ARCH/boot/zImage $sdroot/boot
|
||||||
@@ -78,7 +83,7 @@ sdroot_usable() {
|
|||||||
sdrootsize=(${rawsdrootsize// / })
|
sdrootsize=(${rawsdrootsize// / })
|
||||||
echo $sdrootsize
|
echo $sdrootsize
|
||||||
echo $(($sdrootsize+2))
|
echo $(($sdrootsize+2))
|
||||||
dd if=/dev/zero of=rootfs.ext4 bs=1K count=$(($sdrootsize+3000))
|
dd if=/dev/zero of=rootfs.ext4 bs=1K count=$(($sdrootsize+$sdrootsize))
|
||||||
check $? "Write zero rootfs.ext4"
|
check $? "Write zero rootfs.ext4"
|
||||||
mkfs.ext4 rootfs.ext4
|
mkfs.ext4 rootfs.ext4
|
||||||
check $? "Creating ext4 filesystem"
|
check $? "Creating ext4 filesystem"
|
||||||
@@ -94,7 +99,12 @@ sdroot_usable() {
|
|||||||
sed -i "s/sdcard.img/sdcard_usable.img/g" genimage.cfg
|
sed -i "s/sdcard.img/sdcard_usable.img/g" genimage.cfg
|
||||||
mkdir -v rootmnt
|
mkdir -v rootmnt
|
||||||
sudo mount -v rootfs.ext4 rootmnt
|
sudo mount -v rootfs.ext4 rootmnt
|
||||||
sudo cp -rv $sdroot/* rootmnt/
|
cd $sdroot
|
||||||
|
sudo tar -czvf /tmp/sdroot.tar.gz.tmp .
|
||||||
|
cd $root/out/rootmnt
|
||||||
|
sudo tar -xvf /tmp/sdroot.tar.gz.tmp
|
||||||
|
cd $out
|
||||||
|
# sudo cp -rv $sdroot/* rootmnt/
|
||||||
sudo umount -v rootfs.ext4
|
sudo umount -v rootfs.ext4
|
||||||
rm -rv rootmnt
|
rm -rv rootmnt
|
||||||
mkdir input
|
mkdir input
|
||||||
|
|||||||
@@ -6,3 +6,7 @@ https://github.com/u-boot/u-boot/archive/refs/tags/v2024.10/u-boot-v2024.10.tar.
|
|||||||
https://www.zlib.net/zlib-1.3.1.tar.gz
|
https://www.zlib.net/zlib-1.3.1.tar.gz
|
||||||
https://github.com/mkj/dropbear/archive/refs/tags/DROPBEAR_2024.86.tar.gz
|
https://github.com/mkj/dropbear/archive/refs/tags/DROPBEAR_2024.86.tar.gz
|
||||||
https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz
|
https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.9p1.tar.gz
|
||||||
|
https://curl.se/download/curl-8.9.1.tar.xz
|
||||||
|
https://ftp.gnu.org/gnu/bash/bash-5.2.32.tar.gz
|
||||||
|
https://www.kernel.org/pub/software/scm/git/git-2.46.0.tar.xz
|
||||||
|
https://dl.gitea.com/gitea/1.22.4/gitea-1.22.4-linux-arm-5
|
||||||
Reference in new issue
Block a user