Fix rootfs issue
This commit is contained in:
326
build.sh
326
build.sh
@@ -1,211 +1,140 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
# shellcheck disable=SC2119
|
# shellcheck disable=SC2119
|
||||||
run_sub_stage()
|
run_sub_stage() {
|
||||||
{
|
|
||||||
log "Begin ${SUB_STAGE_DIR}"
|
log "Begin ${SUB_STAGE_DIR}"
|
||||||
pushd "${SUB_STAGE_DIR}" > /dev/null
|
pushd "${SUB_STAGE_DIR}" >/dev/null
|
||||||
for i in {00..99}; do
|
for i in {00..99}; do
|
||||||
if [ -f "${i}-debconf-${ARCH}" ]; then
|
for DEBCONF_FILE in "${i}-debconf-${ARCH}" "${i}-debconf-arm-only" "${i}-debconf"; do
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-debconf-${ARCH}"
|
if [ -f "${SUB_STAGE_DIR}/${DEBCONF_FILE}" ]; then
|
||||||
on_chroot << EOF
|
# Skip arm-only if not arm
|
||||||
|
if [[ "${DEBCONF_FILE}" == *"-debconf-arm-only" ]] && [[ "${ARCH}" != "armhf" && "${ARCH}" != "arm64" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Begin ${SUB_STAGE_DIR}/${DEBCONF_FILE}"
|
||||||
|
|
||||||
|
on_chroot <<EOF
|
||||||
debconf-set-selections <<SELEOF
|
debconf-set-selections <<SELEOF
|
||||||
$(cat "${i}-debconf-${ARCH}")
|
$(cat "${SUB_STAGE_DIR}/${DEBCONF_FILE}")
|
||||||
SELEOF
|
SELEOF
|
||||||
EOF
|
EOF
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-debconf-${ARCH}"
|
|
||||||
elif [ -f "${i}-debconf-arm-only" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
log "End ${SUB_STAGE_DIR}/${DEBCONF_FILE}"
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-debconf-arm-only"
|
|
||||||
on_chroot << EOF
|
|
||||||
debconf-set-selections <<SELEOF
|
|
||||||
$(cat "${i}-debconf-arm-only")
|
|
||||||
SELEOF
|
|
||||||
EOF
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-debconf-arm-only"
|
|
||||||
elif [ -f "${i}-debconf" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-debconf"
|
|
||||||
on_chroot << EOF
|
|
||||||
debconf-set-selections <<SELEOF
|
|
||||||
$(cat "${i}-debconf")
|
|
||||||
SELEOF
|
|
||||||
EOF
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-debconf"
|
|
||||||
fi
|
|
||||||
if [ -f "${i}-packages-nr-${ARCH}" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-packages-nr-${ARCH}"
|
|
||||||
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-nr-${ARCH}")"
|
|
||||||
if [ -n "$PACKAGES" ]; then
|
|
||||||
on_chroot << EOF
|
|
||||||
apt-get -o Acquire::Retries=3 install --no-install-recommends -y $PACKAGES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-packages-nr-${ARCH}"
|
|
||||||
elif [ -f "${i}-packages-nr-arm-only" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-packages-nr-arm-only"
|
|
||||||
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-nr-arm-only")"
|
|
||||||
if [ -n "$PACKAGES" ]; then
|
|
||||||
on_chroot << EOF
|
|
||||||
apt-get -o Acquire::Retries=3 install --no-install-recommends -y $PACKAGES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-packages-nr-arm-only"
|
|
||||||
elif [ -f "${i}-packages-nr" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-packages-nr"
|
|
||||||
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-nr")"
|
|
||||||
if [ -n "$PACKAGES" ]; then
|
|
||||||
on_chroot << EOF
|
|
||||||
apt-get -o Acquire::Retries=3 install --no-install-recommends -y $PACKAGES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-packages-nr"
|
|
||||||
fi
|
|
||||||
if [ -f "${i}-packages-${ARCH}" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-packages-${ARCH}"
|
|
||||||
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-${ARCH}")"
|
|
||||||
if [ -n "$PACKAGES" ]; then
|
|
||||||
on_chroot << EOF
|
|
||||||
apt-get -o Acquire::Retries=3 install -y $PACKAGES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-packages-${ARCH}"
|
|
||||||
elif [ -f "${i}-packages-arm-only" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-packages-arm-only"
|
|
||||||
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-arm-only")"
|
|
||||||
if [ -n "$PACKAGES" ]; then
|
|
||||||
on_chroot << EOF
|
|
||||||
apt-get -o Acquire::Retries=3 install -y $PACKAGES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-packages-arm-only"
|
|
||||||
elif [ -f "${i}-packages" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-packages"
|
|
||||||
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages")"
|
|
||||||
if [ -n "$PACKAGES" ]; then
|
|
||||||
on_chroot << EOF
|
|
||||||
apt-get -o Acquire::Retries=3 install -y $PACKAGES
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-packages"
|
|
||||||
fi
|
|
||||||
if [ -d "${i}-patches-${ARCH}" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-patches-${ARCH}"
|
|
||||||
pushd "${STAGE_WORK_DIR}" > /dev/null
|
|
||||||
if [ "${CLEAN}" = "1" ]; then
|
|
||||||
rm -rf .pc
|
|
||||||
rm -rf ./*-pc
|
|
||||||
fi
|
|
||||||
QUILT_PATCHES="${SUB_STAGE_DIR}/${i}-patches-${ARCH}"
|
|
||||||
SUB_STAGE_QUILT_PATCH_DIR="$(basename "$SUB_STAGE_DIR")-pc"
|
|
||||||
mkdir -p "$SUB_STAGE_QUILT_PATCH_DIR"
|
|
||||||
ln -snf "$SUB_STAGE_QUILT_PATCH_DIR" .pc
|
|
||||||
quilt upgrade
|
|
||||||
if [ -e "${SUB_STAGE_DIR}/${i}-patches-${ARCH}/EDIT" ]; then
|
|
||||||
echo "Dropping into bash to edit patches..."
|
|
||||||
bash
|
|
||||||
fi
|
|
||||||
RC=0
|
|
||||||
quilt push -a || RC=$?
|
|
||||||
case "$RC" in
|
|
||||||
0|2)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
false
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
popd > /dev/null
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-patches-${ARCH}"
|
|
||||||
elif [ -d "${i}-patches-arm-only" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-patches-arm-only"
|
|
||||||
pushd "${STAGE_WORK_DIR}" > /dev/null
|
|
||||||
if [ "${CLEAN}" = "1" ]; then
|
|
||||||
rm -rf .pc
|
|
||||||
rm -rf ./*-pc
|
|
||||||
fi
|
|
||||||
QUILT_PATCHES="${SUB_STAGE_DIR}/${i}-patches-arm-only"
|
|
||||||
SUB_STAGE_QUILT_PATCH_DIR="$(basename "$SUB_STAGE_DIR")-pc"
|
|
||||||
mkdir -p "$SUB_STAGE_QUILT_PATCH_DIR"
|
|
||||||
ln -snf "$SUB_STAGE_QUILT_PATCH_DIR" .pc
|
|
||||||
quilt upgrade
|
|
||||||
if [ -e "${SUB_STAGE_DIR}/${i}-patches-arm-only/EDIT" ]; then
|
|
||||||
echo "Dropping into bash to edit patches..."
|
|
||||||
bash
|
|
||||||
fi
|
|
||||||
RC=0
|
|
||||||
quilt push -a || RC=$?
|
|
||||||
case "$RC" in
|
|
||||||
0|2)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
false
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
popd > /dev/null
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-patches-arm-only"
|
|
||||||
elif [ -d "${i}-patches" ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-patches"
|
|
||||||
pushd "${STAGE_WORK_DIR}" > /dev/null
|
|
||||||
if [ "${CLEAN}" = "1" ]; then
|
|
||||||
rm -rf .pc
|
|
||||||
rm -rf ./*-pc
|
|
||||||
fi
|
|
||||||
QUILT_PATCHES="${SUB_STAGE_DIR}/${i}-patches"
|
|
||||||
SUB_STAGE_QUILT_PATCH_DIR="$(basename "$SUB_STAGE_DIR")-pc"
|
|
||||||
mkdir -p "$SUB_STAGE_QUILT_PATCH_DIR"
|
|
||||||
ln -snf "$SUB_STAGE_QUILT_PATCH_DIR" .pc
|
|
||||||
quilt upgrade
|
|
||||||
if [ -e "${SUB_STAGE_DIR}/${i}-patches/EDIT" ]; then
|
|
||||||
echo "Dropping into bash to edit patches..."
|
|
||||||
bash
|
|
||||||
fi
|
|
||||||
RC=0
|
|
||||||
quilt push -a || RC=$?
|
|
||||||
case "$RC" in
|
|
||||||
0|2)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
false
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
popd > /dev/null
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-patches"
|
|
||||||
fi
|
|
||||||
if [ -x ${i}-run-${ARCH}.sh ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-run-${ARCH}.sh"
|
|
||||||
./${i}-run-${ARCH}.sh
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-run-${ARCH}.sh"
|
|
||||||
elif [ -x "${i}-run-arm-only.sh" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-run-arm-only.sh"
|
|
||||||
./${i}-run-arm-only.sh
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-run-arm-only.sh"
|
|
||||||
elif [ -x ${i}-run.sh ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-run.sh"
|
|
||||||
./${i}-run.sh
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-run.sh"
|
|
||||||
fi
|
|
||||||
if [ -f ${i}-run-chroot-${ARCH}.sh ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot-${ARCH}.sh"
|
|
||||||
on_chroot < ${i}-run-chroot-${ARCH}.sh
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-run-chroot-${ARCH}.sh"
|
|
||||||
elif [ -f "${i}-run-chroot-arm-only.sh" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot-arm-only.sh"
|
|
||||||
on_chroot < ${i}-run-chroot-arm-only.sh
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-run-chroot-arm-only.sh"
|
|
||||||
elif [ -f ${i}-run-chroot.sh ]; then
|
|
||||||
log "Begin ${SUB_STAGE_DIR}/${i}-run-chroot.sh"
|
|
||||||
on_chroot < ${i}-run-chroot.sh
|
|
||||||
log "End ${SUB_STAGE_DIR}/${i}-run-chroot.sh"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
popd > /dev/null
|
for PACKAGE_LIST in "${i}-packages-nr-${ARCH}" "${i}-packages-nr-arm-only" "${i}-packages-nr"; do
|
||||||
|
if [ -f "${SUB_STAGE_DIR}/${PACKAGE_LIST}" ]; then
|
||||||
|
# Skip arm-only packages if not arm architecture
|
||||||
|
if [[ "${PACKAGE_LIST}" == *"-nr-arm-only" ]] && [[ "${ARCH}" != "armhf" && "${ARCH}" != "arm64" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Begin ${SUB_STAGE_DIR}/${PACKAGE_LIST}"
|
||||||
|
|
||||||
|
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" <"${SUB_STAGE_DIR}/${PACKAGE_LIST}")"
|
||||||
|
|
||||||
|
if [ -n "$PACKAGES" ]; then
|
||||||
|
on_chroot <<EOF
|
||||||
|
apt-get -o Acquire::Retries=3 install --no-install-recommends -y $PACKAGES
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "End ${SUB_STAGE_DIR}/${PACKAGE_LIST}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for PACKAGE_LIST in "${i}-packages-${ARCH}" "${i}-packages-arm-only" "${i}-packages"; do
|
||||||
|
if [ -f "${SUB_STAGE_DIR}/${PACKAGE_LIST}" ]; then
|
||||||
|
# Skip arm-only packages if not arm architecture
|
||||||
|
if [[ "${PACKAGE_LIST}" == *"-packages-arm-only" ]] && [[ "${ARCH}" != "armhf" && "${ARCH}" != "arm64" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Begin ${SUB_STAGE_DIR}/${PACKAGE_LIST}"
|
||||||
|
|
||||||
|
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" <"${SUB_STAGE_DIR}/${PACKAGE_LIST}")"
|
||||||
|
|
||||||
|
if [ -n "$PACKAGES" ]; then
|
||||||
|
on_chroot <<EOF
|
||||||
|
apt-get -o Acquire::Retries=3 install -y $PACKAGES
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "End ${SUB_STAGE_DIR}/${PACKAGE_LIST}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for PATCH_DIR in "${i}-patches-${ARCH}" "${i}-patches-arm-only" "${i}-patches"; do
|
||||||
|
if [ -d "${SUB_STAGE_DIR}/${PATCH_DIR}" ]; then
|
||||||
|
# Check arm-only patches should only apply for armhf/arm64
|
||||||
|
if [[ "${PATCH_DIR}" == *"-patches-arm-only" ]] && [[ "${ARCH}" != "armhf" && "${ARCH}" != "arm64" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Begin ${SUB_STAGE_DIR}/${PATCH_DIR}"
|
||||||
|
pushd "${STAGE_WORK_DIR}" >/dev/null
|
||||||
|
|
||||||
|
if [ "${CLEAN}" = "1" ]; then
|
||||||
|
rm -rf .pc
|
||||||
|
rm -rf ./*-pc
|
||||||
|
fi
|
||||||
|
|
||||||
|
QUILT_PATCHES="${SUB_STAGE_DIR}/${PATCH_DIR}"
|
||||||
|
SUB_STAGE_QUILT_PATCH_DIR="$(basename "$SUB_STAGE_DIR")-pc"
|
||||||
|
mkdir -p "$SUB_STAGE_QUILT_PATCH_DIR"
|
||||||
|
ln -snf "$SUB_STAGE_QUILT_PATCH_DIR" .pc
|
||||||
|
|
||||||
|
quilt upgrade
|
||||||
|
|
||||||
|
if [ -e "${SUB_STAGE_DIR}/${PATCH_DIR}/EDIT" ]; then
|
||||||
|
echo "Dropping into bash to edit patches..."
|
||||||
|
bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
RC=0
|
||||||
|
quilt push -a || RC=$?
|
||||||
|
case "$RC" in
|
||||||
|
0 | 2) ;; # 0 = success, 2 = "already applied"
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
popd >/dev/null
|
||||||
|
log "End ${SUB_STAGE_DIR}/${PATCH_DIR}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for RUN_SCRIPT in "${i}-run-${ARCH}.sh" "${i}-run-arm-only.sh" "${i}-run.sh"; do
|
||||||
|
if [ -x "${SUB_STAGE_DIR}/${RUN_SCRIPT}" ]; then
|
||||||
|
# Skip arm-only if not arm
|
||||||
|
if [[ "${RUN_SCRIPT}" == *"-arm-only.sh" ]] && [[ "${ARCH}" != "armhf" && "${ARCH}" != "arm64" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Begin ${SUB_STAGE_DIR}/${RUN_SCRIPT}"
|
||||||
|
"./${RUN_SCRIPT}"
|
||||||
|
log "End ${SUB_STAGE_DIR}/${RUN_SCRIPT}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
for CHROOT_SCRIPT in "${i}-run-chroot-${ARCH}.sh" "${i}-run-chroot-arm-only.sh" "${i}-run-chroot.sh"; do
|
||||||
|
if [ -f "${SUB_STAGE_DIR}/${CHROOT_SCRIPT}" ]; then
|
||||||
|
# Skip arm-only if not arm
|
||||||
|
if [[ "${CHROOT_SCRIPT}" == *"-arm-only.sh" ]] && [[ "${ARCH}" != "armhf" && "${ARCH}" != "arm64" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
log "Begin ${SUB_STAGE_DIR}/${CHROOT_SCRIPT}"
|
||||||
|
on_chroot <"${SUB_STAGE_DIR}/${CHROOT_SCRIPT}"
|
||||||
|
log "End ${SUB_STAGE_DIR}/${CHROOT_SCRIPT}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
popd >/dev/null
|
||||||
log "End ${SUB_STAGE_DIR}"
|
log "End ${SUB_STAGE_DIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run_stage() {
|
||||||
run_stage(){
|
|
||||||
log "Begin ${STAGE_DIR}"
|
log "Begin ${STAGE_DIR}"
|
||||||
STAGE="$(basename "${STAGE_DIR}")"
|
STAGE="$(basename "${STAGE_DIR}")"
|
||||||
|
|
||||||
pushd "${STAGE_DIR}" > /dev/null
|
pushd "${STAGE_DIR}" >/dev/null
|
||||||
|
|
||||||
STAGE_WORK_DIR="${WORK_DIR}/${STAGE}"
|
STAGE_WORK_DIR="${WORK_DIR}/${STAGE}"
|
||||||
ROOTFS_DIR="${STAGE_WORK_DIR}"/rootfs
|
ROOTFS_DIR="${STAGE_WORK_DIR}"/rootfs
|
||||||
@@ -242,7 +171,7 @@ run_stage(){
|
|||||||
PREV_STAGE="${STAGE}"
|
PREV_STAGE="${STAGE}"
|
||||||
PREV_STAGE_DIR="${STAGE_DIR}"
|
PREV_STAGE_DIR="${STAGE_DIR}"
|
||||||
PREV_ROOTFS_DIR="${ROOTFS_DIR}"
|
PREV_ROOTFS_DIR="${ROOTFS_DIR}"
|
||||||
popd > /dev/null
|
popd >/dev/null
|
||||||
log "End ${STAGE_DIR}"
|
log "End ${STAGE_DIR}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,16 +210,14 @@ if [ -f config ]; then
|
|||||||
source config
|
source config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts "c:" flag
|
while getopts "c:" flag; do
|
||||||
do
|
|
||||||
case "$flag" in
|
case "$flag" in
|
||||||
c)
|
c)
|
||||||
EXTRA_CONFIG="$OPTARG"
|
EXTRA_CONFIG="$OPTARG"
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$EXTRA_CONFIG"
|
source "$EXTRA_CONFIG"
|
||||||
;;
|
;;
|
||||||
*)
|
*) ;;
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -368,7 +295,6 @@ trap term EXIT INT TERM
|
|||||||
|
|
||||||
dependencies_check "${BASE_DIR}/depends"
|
dependencies_check "${BASE_DIR}/depends"
|
||||||
|
|
||||||
|
|
||||||
PAGESIZE=$(getconf PAGESIZE)
|
PAGESIZE=$(getconf PAGESIZE)
|
||||||
if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
|
if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
|
||||||
echo
|
echo
|
||||||
@@ -396,12 +322,12 @@ if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${APT_PROXY}" ]] && ! curl --silent "${APT_PROXY}" >/dev/null ; then
|
if [[ -n "${APT_PROXY}" ]] && ! curl --silent "${APT_PROXY}" >/dev/null; then
|
||||||
echo "Could not reach APT_PROXY server: ${APT_PROXY}"
|
echo "Could not reach APT_PROXY server: ${APT_PROXY}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${WPA_PASSWORD}" && ${#WPA_PASSWORD} -lt 8 || ${#WPA_PASSWORD} -gt 63 ]] ; then
|
if [[ -n "${WPA_PASSWORD}" && ${#WPA_PASSWORD} -lt 8 || ${#WPA_PASSWORD} -gt 63 ]]; then
|
||||||
echo "WPA_PASSWORD" must be between 8 and 63 characters
|
echo "WPA_PASSWORD" must be between 8 and 63 characters
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -70,14 +70,14 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mkdosfs -n bootfs -F "$FAT_SIZE" -s 4 -v "$BOOT_DEV" > /dev/null
|
mkdosfs -n bootfs -F "$FAT_SIZE" -s 4 -v "$BOOT_DEV" > /dev/null
|
||||||
mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null
|
|
||||||
mkfs.ext4 -L recovery -O "$ROOT_FEATURES" "$RECOVERY_DEV" > /dev/null
|
mkfs.ext4 -L recovery -O "$ROOT_FEATURES" "$RECOVERY_DEV" > /dev/null
|
||||||
|
mkfs.ext4 -L rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null
|
||||||
|
|
||||||
mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4
|
mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4
|
||||||
mkdir -p "${ROOTFS_DIR}/boot/firmware"
|
mkdir -p "${ROOTFS_DIR}/boot/firmware"
|
||||||
mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot/firmware" -t vfat
|
mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot/firmware" -t vfat
|
||||||
mkdir -p "${ROOTFS_DIR}/recovery"
|
#mkdir -p "${ROOTFS_DIR}/recovery"
|
||||||
mount -v "$RECOVERY_DEV" "${ROOTFS_DIR}/recovery" -t ext4
|
#mount -v "$RECOVERY_DEV" "${ROOTFS_DIR}/recovery" -t ext4
|
||||||
|
|
||||||
rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot/firmware "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
|
rsync -aHAXx --exclude /var/cache/apt/archives --exclude /boot/firmware "${EXPORT_ROOTFS_DIR}/" "${ROOTFS_DIR}/"
|
||||||
rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/firmware/" "${ROOTFS_DIR}/boot/firmware/"
|
rsync -rtx "${EXPORT_ROOTFS_DIR}/boot/firmware/" "${ROOTFS_DIR}/boot/firmware/"
|
||||||
|
|||||||
Reference in New Issue
Block a user