rootfsinstall: rpi: several fixes or workarounds after testing changes in previous commit
This commit is contained in:
parent
b857fc85cc
commit
824abd9ffa
@ -139,7 +139,7 @@ mkdir -p /run/systemd
|
||||
mount /boot
|
||||
mount / -o remount,ro
|
||||
|
||||
sed -i 's| init=/usr/share/openmamba/bin/init_resize\.sh||' /boot/cmdline.txt
|
||||
sed -i 's| init=/usr/libexec/init_resize||' /boot/cmdline.txt
|
||||
sed -i 's| sdhci\.debug_quirks2=4||' /boot/cmdline.txt
|
||||
|
||||
if ! grep -q splash /boot/cmdline.txt; then
|
||||
|
@ -215,7 +215,8 @@ case $TARGETDEVICE in
|
||||
KERNELDEST="@BOOT@/kernel.img"
|
||||
KERNELDEST2="@BOOT@/kernel7.img"
|
||||
KERNELDEST3="@BOOT@/kernel7l.img"
|
||||
INSTALLPACKAGES="kernel-rpi kernel-rpi-modules raspberrypi-firmware \
|
||||
INSTALLPACKAGES="\
|
||||
kernel-rpi kernel-rpi-modules \
|
||||
kernel-rpi-v7 kernel-rpi-v7-modules \
|
||||
kernel-rpi-v7l kernel-rpi-v7l-modules \
|
||||
raspberrypi-utils xf86-video-fbturbo $INSTALLPACKAGES"
|
||||
@ -356,17 +357,19 @@ mount $PARTITION2 $ROOTMP || {
|
||||
echo "ERROR: unable to mount partition $PARTITION2; aborting."
|
||||
exit 1
|
||||
}
|
||||
trap "[ "$ROOTMP" -a -e $ROOTMP ] && umount $ROOTMP/dev/pts $ROOTMP/dev $ROOTMP/proc $ROOTMP/sys $ROOTMP/run $ROOTMP && rmdir $ROOTMP;[ "$BOOTMP" -a -e $BOOTMP ] && umount $BOOTMP && rmdir $BOOTMP" 0 HUP INT QUIT ABRT KILL TERM
|
||||
|
||||
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
|
||||
|
||||
(
|
||||
cd $ROOTMP >/dev/null || {
|
||||
echo "ERROR: unable to access system partition mount point; aborting."
|
||||
@ -444,12 +447,13 @@ if [ "$INSTALLPACKAGES" -a "$LOCALONLY" != "1" -a ! "${IMAGEMODE}" ]; then
|
||||
echo "ERROR: error running chroot command 'rpm --rebuilddb'; aborting."
|
||||
exit 1
|
||||
}
|
||||
chroot $ROOTMP dnf update -y || {
|
||||
echo "ERROR: error running chroot command 'dnf update -y'; aborting."
|
||||
chroot $ROOTMP dnf update --nogpgcheck -y || {
|
||||
echo "ERROR: error running chroot command 'dnf update --nogpgcheck -y'; aborting."
|
||||
exit 1
|
||||
}
|
||||
chroot $ROOTMP dnf install -y $INSTALLPACKAGES || {
|
||||
echo "ERROR: error running chroot command 'dnf install -y $INSTALLPACKAGES'; aborting."
|
||||
# dnf: diskspacecheck=0 workaround for bad free space calculations in chroot
|
||||
chroot $ROOTMP dnf install --nogpgcheck --setopt diskspacecheck=0 -y $INSTALLPACKAGES || {
|
||||
echo "ERROR: error running chroot command 'dnf install --nogpgcheck -y $INSTALLPACKAGES'; aborting."
|
||||
exit 1
|
||||
}
|
||||
#chroot $ROOTMP smart channel --disable devel-kernel
|
||||
@ -457,7 +461,7 @@ if [ "$INSTALLPACKAGES" -a "$LOCALONLY" != "1" -a ! "${IMAGEMODE}" ]; then
|
||||
fi
|
||||
|
||||
if [ "$REMOVEPACKAGES" -a ! "${IMAGEMODE}" ]; then
|
||||
chroot $ROOTMP dnf remove -y $REMOVEPACKAGES 2>/dev/null || true
|
||||
chroot $ROOTMP dnf remove --nogpgcheck -y $REMOVEPACKAGES 2>/dev/null || true
|
||||
fi
|
||||
|
||||
KERNELDEST=`echo $KERNELDEST | sed "s|@BOOT@|$BOOTMP|g"`
|
||||
@ -546,18 +550,19 @@ _EOF
|
||||
dd if=$ROOTMP/boot/Bananapi/u-boot-sunxi-with-spl.bin of=${DRIVE} bs=1024 seek=8
|
||||
:
|
||||
elif [ "$TARGETDEVICE" = "rpi" ]; then
|
||||
[ "$USEKERNEL" -a -e $KERNELDEST ] || cp $ROOTMP/boot/$USEKERNEL $KERNELDEST
|
||||
[ "$USEKERNEL2" -a -e $KERNELDEST2 ] || cp $ROOTMP/boot/$USEKERNEL2 $KERNELDEST2
|
||||
[ "$USEKERNEL3" -a -e $KERNELDEST3 ] || cp $ROOTMP/boot/$USEKERNEL3 $KERNELDEST3
|
||||
[ "$USEKERNEL" ] && cp $ROOTMP/boot/$USEKERNEL $KERNELDEST
|
||||
[ "$USEKERNEL2" ] && cp $ROOTMP/boot/$USEKERNEL2 $KERNELDEST2
|
||||
[ "$USEKERNEL3" ] && cp $ROOTMP/boot/$USEKERNEL3 $KERNELDEST3
|
||||
|
||||
[ -e /usr/libexec/init_resize ] && cp /usr/libexec/init_resize ${ROOTMP}/usr/libexec/
|
||||
[ -e ${ROOTMP}/usr/libexec/init_resize ] && CMDLINE_ADD=" init=/usr/libexec/init_resize"
|
||||
|
||||
chroot $ROOTMP depmod -ae
|
||||
|
||||
# cmdline.txt : parameters passed to the kernel on boot
|
||||
[ ! -e $ROOTMP/boot/cmdline.txt ] && \
|
||||
echo "\
|
||||
dwc_otg.lpm_enable=0 \
|
||||
root=/dev/mmcblk0p2 \
|
||||
root=/dev/mmcblk0p2 rw \
|
||||
rootfstype=$SYSTEMFSTYPE \
|
||||
quiet \
|
||||
rootwait \
|
||||
@ -625,7 +630,7 @@ fi
|
||||
|
||||
if [ "$FSTAB_BOOT_DEVICE" ]; then
|
||||
cat >> $ROOTMP/etc/fstab << _EOF
|
||||
$FSTAB_BOOT_DEVICE / auto defaults 0 2
|
||||
$FSTAB_BOOT_DEVICE /boot auto defaults 0 2
|
||||
_EOF
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user