Add support for --update-checksums in early bootstrap
This allows creating *.checksums files instead of checking against them when UPDATE_CHECKSUMS is set to True in bootstrap.cfg. The checksums are also copied to /usr/src so they can be accessed easily after the bootstrap completes.
This commit is contained in:
parent
18fa642100
commit
653f31b59f
|
@ -18,9 +18,10 @@ prefix=/usr
|
||||||
bindir=${prefix}/bin
|
bindir=${prefix}/bin
|
||||||
libdir=${prefix}/lib
|
libdir=${prefix}/lib
|
||||||
incdir=${prefix}/include
|
incdir=${prefix}/include
|
||||||
|
srcdir=${prefix}/src
|
||||||
TMPDIR=/tmp # tmpdir is needed for patch to work
|
TMPDIR=/tmp # tmpdir is needed for patch to work
|
||||||
|
|
||||||
mkdir -p ${prefix} ${bindir} ${libdir} ${incdir} ${TMPDIR}
|
mkdir -p ${prefix} ${bindir} ${libdir} ${incdir} ${srcdir} ${TMPDIR}
|
||||||
|
|
||||||
# Remove remaining dependencies on /bin (stage0-posix directory)
|
# Remove remaining dependencies on /bin (stage0-posix directory)
|
||||||
cp /${ARCH_DIR}/bin/blood-elf ${bindir}/blood-elf
|
cp /${ARCH_DIR}/bin/blood-elf ${bindir}/blood-elf
|
||||||
|
|
|
@ -51,4 +51,11 @@ ln -s ${prefix}/bin/bash ${prefix}/bin/sh
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/bash
|
||||||
|
|
||||||
|
install ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -35,4 +35,11 @@ bzip2 --help
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/bzip2
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -38,4 +38,64 @@ cd ../..
|
||||||
rm -r src/
|
rm -r src/
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/install \
|
||||||
|
/usr/bin/basename \
|
||||||
|
/usr/bin/cat \
|
||||||
|
/usr/bin/chmod \
|
||||||
|
/usr/bin/cksum \
|
||||||
|
/usr/bin/cp \
|
||||||
|
/usr/bin/csplit \
|
||||||
|
/usr/bin/cut \
|
||||||
|
/usr/bin/echo \
|
||||||
|
/usr/bin/expand \
|
||||||
|
/usr/bin/factor \
|
||||||
|
/usr/bin/false \
|
||||||
|
/usr/bin/fmt \
|
||||||
|
/usr/bin/fold \
|
||||||
|
/usr/bin/head \
|
||||||
|
/usr/bin/id \
|
||||||
|
/usr/bin/join \
|
||||||
|
/usr/bin/kill \
|
||||||
|
/usr/bin/link \
|
||||||
|
/usr/bin/ln \
|
||||||
|
/usr/bin/logname \
|
||||||
|
/usr/bin/mkfifo \
|
||||||
|
/usr/bin/mkdir \
|
||||||
|
/usr/bin/mknod \
|
||||||
|
/usr/bin/nl \
|
||||||
|
/usr/bin/od \
|
||||||
|
/usr/bin/paste \
|
||||||
|
/usr/bin/pathchk \
|
||||||
|
/usr/bin/printf \
|
||||||
|
/usr/bin/ptx \
|
||||||
|
/usr/bin/pwd \
|
||||||
|
/usr/bin/readlink \
|
||||||
|
/usr/bin/rmdir \
|
||||||
|
/usr/bin/seq \
|
||||||
|
/usr/bin/sleep \
|
||||||
|
/usr/bin/split \
|
||||||
|
/usr/bin/sum \
|
||||||
|
/usr/bin/tail \
|
||||||
|
/usr/bin/tee \
|
||||||
|
/usr/bin/tr \
|
||||||
|
/usr/bin/tsort \
|
||||||
|
/usr/bin/unexpand \
|
||||||
|
/usr/bin/unlink \
|
||||||
|
/usr/bin/wc \
|
||||||
|
/usr/bin/whoami \
|
||||||
|
/usr/bin/test \
|
||||||
|
/usr/bin/touch \
|
||||||
|
/usr/bin/true \
|
||||||
|
/usr/bin/yes \
|
||||||
|
/usr/bin/ls \
|
||||||
|
/usr/bin/md5sum \
|
||||||
|
/usr/bin/mv \
|
||||||
|
/usr/bin/rm \
|
||||||
|
/usr/bin/sha1sum
|
||||||
|
|
||||||
|
install ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -37,4 +37,11 @@ chmod 755 ${bindir}/gunzip
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/gzip
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -44,4 +44,15 @@ install -m 644 ncform ${lexdir}
|
||||||
cd ../../..
|
cd ../../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/yacc \
|
||||||
|
/usr/bin/lex \
|
||||||
|
/usr/lib/mes/libl.a \
|
||||||
|
/yaccpar \
|
||||||
|
/lex/ncform
|
||||||
|
|
||||||
|
install ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -55,4 +55,11 @@ make --version
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/make
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -314,6 +314,27 @@ cp include/sys/ucontext.h ${incdir}/sys/ucontext.h
|
||||||
cp include/sys/user.h ${incdir}/sys/user.h
|
cp include/sys/user.h ${incdir}/sys/user.h
|
||||||
cp include/sys/wait.h ${incdir}/sys/wait.h
|
cp include/sys/wait.h ${incdir}/sys/wait.h
|
||||||
|
|
||||||
# Checksums
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/mes \
|
||||||
|
/usr/bin/mes-m2 \
|
||||||
|
/usr/bin/mescc.scm \
|
||||||
|
/usr/lib/x86-mes/crt1.s \
|
||||||
|
/usr/lib/x86-mes/crt1.o \
|
||||||
|
/usr/lib/x86-mes/x86.M1 \
|
||||||
|
/usr/lib/x86-mes/libmescc.s \
|
||||||
|
/usr/lib/x86-mes/libc+tcc.s \
|
||||||
|
/usr/lib/x86-mes/libc.s \
|
||||||
|
/usr/lib/x86-mes/libmescc.a \
|
||||||
|
/usr/lib/x86-mes/libc+tcc.a \
|
||||||
|
/usr/lib/x86-mes/libc.a \
|
||||||
|
/usr/lib/linux/x86-mes/elf32-header.hex2 \
|
||||||
|
/usr/lib/linux/x86-mes/elf32-footer-single-main.hex2
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -34,4 +34,11 @@ chmod 755 ${prefix}/bin/patch
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/patch
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
11
sysa/run.sh
11
sysa/run.sh
|
@ -16,19 +16,18 @@ export PREFIX="${prefix}"
|
||||||
export SOURCES="${sysa}"
|
export SOURCES="${sysa}"
|
||||||
export DISTFILES="${sysa}/distfiles"
|
export DISTFILES="${sysa}/distfiles"
|
||||||
export DESTDIR=/tmp/destdir
|
export DESTDIR=/tmp/destdir
|
||||||
export REPO="${PREFIX}/src/repo"
|
# shellcheck disable=SC2154
|
||||||
|
export SRCDIR="${srcdir}"
|
||||||
|
|
||||||
create_sysb() {
|
create_sysb() {
|
||||||
# Copy everything in
|
# Copy everything in
|
||||||
echo "Creating sysb rootfs"
|
echo "Creating sysb rootfs"
|
||||||
mkdir -p "/sysb${PREFIX}"
|
mkdir -p "/sysb${PREFIX}"
|
||||||
for d in bin include lib libexec share; do
|
for d in bin include lib libexec share src; do
|
||||||
# Minimise RAM (storage) use - use hard links
|
# Minimise RAM (storage) use - use hard links
|
||||||
cp -rl "${PREFIX}/${d}" "/sysb${PREFIX}/${d}"
|
cp -rl "${PREFIX}/${d}" "/sysb${PREFIX}/${d}"
|
||||||
done
|
done
|
||||||
mkdir /sysb/usr/src
|
cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "/sysb/${SRCDIR}"
|
||||||
cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" /sysb/usr/src/
|
|
||||||
cp -rl "${REPO}" "/sysb/${REPO}"
|
|
||||||
populate_device_nodes /sysb
|
populate_device_nodes /sysb
|
||||||
echo "Creating sysb initramfs"
|
echo "Creating sysb initramfs"
|
||||||
gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb
|
gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb
|
||||||
|
@ -101,7 +100,7 @@ echo "Thank you! All done."
|
||||||
|
|
||||||
echo "ARCH=${ARCH}" >> "${SOURCES}/bootstrap.cfg"
|
echo "ARCH=${ARCH}" >> "${SOURCES}/bootstrap.cfg"
|
||||||
|
|
||||||
mkdir -p "${DESTDIR}" "${REPO}" /dev
|
mkdir -p "${DESTDIR}" "${SRCDIR}/repo" /dev
|
||||||
|
|
||||||
build flex-2.5.11
|
build flex-2.5.11
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,11 @@ chmod 755 ${prefix}/bin/sed
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/sed
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -34,4 +34,11 @@ chmod 755 ${prefix}/bin/tar
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/tar
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -388,4 +388,23 @@ tcc -ar cr ${libdir}/libgetopt.a getopt.o
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/mes-tcc \
|
||||||
|
/usr/bin/boot0-tcc \
|
||||||
|
/usr/bin/boot1-tcc \
|
||||||
|
/usr/bin/boot2-tcc \
|
||||||
|
/usr/bin/boot3-tcc \
|
||||||
|
/usr/bin/boot4-tcc \
|
||||||
|
/usr/bin/tcc \
|
||||||
|
/usr/lib/mes/libc.a \
|
||||||
|
/usr/lib/mes/libgetopt.a \
|
||||||
|
/usr/lib/mes/crt1.o \
|
||||||
|
/usr/lib/mes/crti.o \
|
||||||
|
/usr/lib/mes/crtn.o \
|
||||||
|
/usr/lib/mes/tcc/libtcc1.a
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
|
@ -47,4 +47,11 @@ tcc -version
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
# Checksums
|
# Checksums
|
||||||
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
||||||
|
sha256sum -o ${pkg}.checksums \
|
||||||
|
/usr/bin/tcc
|
||||||
|
|
||||||
|
cp ${pkg}.checksums ${srcdir}
|
||||||
|
else
|
||||||
sha256sum -c ${pkg}.checksums
|
sha256sum -c ${pkg}.checksums
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue