Fix rootfs issue
This commit is contained in:
346
build.sh
346
build.sh
@@ -1,211 +1,140 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# shellcheck disable=SC2119
|
||||
run_sub_stage()
|
||||
{
|
||||
run_sub_stage() {
|
||||
log "Begin ${SUB_STAGE_DIR}"
|
||||
pushd "${SUB_STAGE_DIR}" > /dev/null
|
||||
pushd "${SUB_STAGE_DIR}" >/dev/null
|
||||
for i in {00..99}; do
|
||||
if [ -f "${i}-debconf-${ARCH}" ]; then
|
||||
log "Begin ${SUB_STAGE_DIR}/${i}-debconf-${ARCH}"
|
||||
on_chroot << EOF
|
||||
for DEBCONF_FILE in "${i}-debconf-${ARCH}" "${i}-debconf-arm-only" "${i}-debconf"; do
|
||||
if [ -f "${SUB_STAGE_DIR}/${DEBCONF_FILE}" ]; then
|
||||
# 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
|
||||
$(cat "${i}-debconf-${ARCH}")
|
||||
$(cat "${SUB_STAGE_DIR}/${DEBCONF_FILE}")
|
||||
SELEOF
|
||||
EOF
|
||||
log "End ${SUB_STAGE_DIR}/${i}-debconf-${ARCH}"
|
||||
elif [ -f "${i}-debconf-arm-only" ] && [[ "${ARCH}" == "arm64" || "${ARCH}" == "armhf" ]]; then
|
||||
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
|
||||
|
||||
log "End ${SUB_STAGE_DIR}/${DEBCONF_FILE}"
|
||||
fi
|
||||
done
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
done
|
||||
done
|
||||
popd > /dev/null
|
||||
popd >/dev/null
|
||||
log "End ${SUB_STAGE_DIR}"
|
||||
}
|
||||
|
||||
|
||||
run_stage(){
|
||||
run_stage() {
|
||||
log "Begin ${STAGE_DIR}"
|
||||
STAGE="$(basename "${STAGE_DIR}")"
|
||||
|
||||
pushd "${STAGE_DIR}" > /dev/null
|
||||
pushd "${STAGE_DIR}" >/dev/null
|
||||
|
||||
STAGE_WORK_DIR="${WORK_DIR}/${STAGE}"
|
||||
ROOTFS_DIR="${STAGE_WORK_DIR}"/rootfs
|
||||
@@ -230,9 +159,9 @@ run_stage(){
|
||||
fi
|
||||
for SUB_STAGE_DIR in "${STAGE_DIR}"/*; do
|
||||
if [ -d "${SUB_STAGE_DIR}" ]; then
|
||||
if [ ! -f "${SUB_STAGE_DIR}/SKIP" ] && [ ! -f "${SUB_STAGE_DIR}/SKIP_${ARCH}" ]; then
|
||||
run_sub_stage
|
||||
fi
|
||||
if [ ! -f "${SUB_STAGE_DIR}/SKIP" ] && [ ! -f "${SUB_STAGE_DIR}/SKIP_${ARCH}" ]; then
|
||||
run_sub_stage
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -242,7 +171,7 @@ run_stage(){
|
||||
PREV_STAGE="${STAGE}"
|
||||
PREV_STAGE_DIR="${STAGE_DIR}"
|
||||
PREV_ROOTFS_DIR="${ROOTFS_DIR}"
|
||||
popd > /dev/null
|
||||
popd >/dev/null
|
||||
log "End ${STAGE_DIR}"
|
||||
}
|
||||
|
||||
@@ -281,16 +210,14 @@ if [ -f config ]; then
|
||||
source config
|
||||
fi
|
||||
|
||||
while getopts "c:" flag
|
||||
do
|
||||
while getopts "c:" flag; do
|
||||
case "$flag" in
|
||||
c)
|
||||
EXTRA_CONFIG="$OPTARG"
|
||||
# shellcheck disable=SC1090
|
||||
source "$EXTRA_CONFIG"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
c)
|
||||
EXTRA_CONFIG="$OPTARG"
|
||||
# shellcheck disable=SC1090
|
||||
source "$EXTRA_CONFIG"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -368,7 +295,6 @@ trap term EXIT INT TERM
|
||||
|
||||
dependencies_check "${BASE_DIR}/depends"
|
||||
|
||||
|
||||
PAGESIZE=$(getconf PAGESIZE)
|
||||
if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
|
||||
echo
|
||||
@@ -396,12 +322,12 @@ if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then
|
||||
exit 1
|
||||
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}"
|
||||
exit 1
|
||||
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
|
||||
exit 1
|
||||
fi
|
||||
@@ -435,16 +361,16 @@ for EXPORT_DIR in ${EXPORT_DIRS}; do
|
||||
source "${EXPORT_DIR}/EXPORT_IMAGE"
|
||||
EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename "${EXPORT_DIR}")/rootfs
|
||||
if [ -e "${EXPORT_DIR}/EXPORT_ISO" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "${EXPORT_DIR}/EXPORT_ISO"
|
||||
STAGE_DIR="${BASE_DIR}/export-iso"
|
||||
run_stage
|
||||
elif [ -e "${EXPORT_DIR}/EXPORT_IMAGE" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "${EXPORT_DIR}/EXPORT_IMAGE"
|
||||
STAGE_DIR="${BASE_DIR}/export-image"
|
||||
run_stage
|
||||
fi
|
||||
# shellcheck source=/dev/null
|
||||
source "${EXPORT_DIR}/EXPORT_ISO"
|
||||
STAGE_DIR="${BASE_DIR}/export-iso"
|
||||
run_stage
|
||||
elif [ -e "${EXPORT_DIR}/EXPORT_IMAGE" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "${EXPORT_DIR}/EXPORT_IMAGE"
|
||||
STAGE_DIR="${BASE_DIR}/export-image"
|
||||
run_stage
|
||||
fi
|
||||
if [ "${USE_QEMU}" != "1" ]; then
|
||||
if [ -e "${EXPORT_DIR}/EXPORT_NOOBS" ]; then
|
||||
# shellcheck source=/dev/null
|
||||
|
||||
@@ -70,14 +70,14 @@ else
|
||||
fi
|
||||
|
||||
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 rootfs -O "$ROOT_FEATURES" "$ROOT_DEV" > /dev/null
|
||||
|
||||
mount -v "$ROOT_DEV" "${ROOTFS_DIR}" -t ext4
|
||||
mkdir -p "${ROOTFS_DIR}/boot/firmware"
|
||||
mount -v "$BOOT_DEV" "${ROOTFS_DIR}/boot/firmware" -t vfat
|
||||
mkdir -p "${ROOTFS_DIR}/recovery"
|
||||
mount -v "$RECOVERY_DEV" "${ROOTFS_DIR}/recovery" -t ext4
|
||||
#mkdir -p "${ROOTFS_DIR}/recovery"
|
||||
#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 -rtx "${EXPORT_ROOTFS_DIR}/boot/firmware/" "${ROOTFS_DIR}/boot/firmware/"
|
||||
|
||||
Reference in New Issue
Block a user