rootfsinstall.sh: copy files to boot partition at the end to prevent errors due to unsupported h/s links

This commit is contained in:
Silvan 2024-12-28 12:25:03 +01:00
parent cf872f4586
commit 515388f69d

View File

@ -371,17 +371,7 @@ mount $PARTITION2 $ROOTMP || {
exit 1
}
if [ "$BOOTFSTYPE" ]; then
BOOTMP=$ROOTMP/boot
mkdir $BOOTMP
mount $PARTITION1 $BOOTMP || {
echo "ERROR: unable to mount partition $PARTITION1; aborting."
umount $ROOTMP
exit 1
}
fi
trap "[ "$BOOTMP" -a -e $BOOTMP ] && umount $BOOTMP;[ "$ROOTMP" -a -e $ROOTMP ] && umount $ROOTMP/dev/pts $ROOTMP/dev $ROOTMP/proc $ROOTMP/sys $ROOTMP/run $ROOTMP" 0 HUP INT QUIT ABRT KILL TERM
trap "[ "$ROOTMP" -a -e $ROOTMP ] && umount $ROOTMP/dev/pts $ROOTMP/dev $ROOTMP/proc $ROOTMP/sys $ROOTMP/run $ROOTMP" 0 HUP INT QUIT ABRT KILL TERM
(
cd $ROOTMP >/dev/null || {
@ -394,7 +384,7 @@ trap "[ "$BOOTMP" -a -e $BOOTMP ] && umount $BOOTMP;[ "$ROOTMP" -a -e $ROOTMP ]
if [ ! "${IMAGEMODE}" ]; then
echo "Uncompressing $ROOTFSARCHIVE..."
echo -n "This can take a while, please wait..."
tar xf $ROOTFSARCHIVE --exclude=vexpress-v2m-rs1.dtsi || {
tar xf $ROOTFSARCHIVE || {
echo
echo "ERROR: unable to uncompress rootfs archive; aborting."
exit 1
@ -699,6 +689,20 @@ for c in `seq 1 ${#CHROOTCOMMANDS[*]}`; do
}
done
# Move /boot contents to separate boot partition
if [ "$BOOTFSTYPE" ]; then
BOOTMP=`mktemp -d -t rootfsinstall.XXXXXXXX`
mount $PARTITION1 $BOOTMP || {
echo "ERROR: unable to mount partition $PARTITION1; aborting."
exit 1
}
trap "[ "$BOOTMP" -a -e $BOOTMP ] && umount $BOOTMP;[ "$ROOTMP" -a -e $ROOTMP ] && umount $ROOTMP/dev/pts $ROOTMP/dev $ROOTMP/proc $ROOTMP/sys $ROOTMP/run $ROOTMP" 0 HUP INT QUIT ABRT KILL TERM
cp -rL $ROOTMP/boot/* $BOOTMP/ || {
echo "ERROR: unable to move files from $ROOTMP/boot to partition $PARTITION1; aborting."
exit 1
}
[ "$ROOTMP" != "" ] && rm -rf $ROOTMP/boot/*
fi
# Kill any daemon process run in chroot
FOUND=0