add PARTUUID of root to fstab
Also fix overlay permissions again, since it turns out that minimal and server editions might also have polkit stuff installed. Also do some indentation cleanup Signed-off-by: Dan Johansen <strit@manjaro.org>
This commit is contained in:
parent
b21b615027
commit
e228cd14d8
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Set globals
|
||||
# *****************************
|
||||
VERSION="1.4.4"
|
||||
VERSION="1.4.5"
|
||||
# *****************************
|
||||
TMPDIR=/var/tmp/manjaro-arm-installer
|
||||
ARCH='aarch64'
|
||||
|
|
@ -207,11 +207,12 @@ create_install() {
|
|||
sed -i s/"enable systemd-resolved.service"/"#enable systemd-resolved.service"/ $TMPDIR/root/usr/lib/systemd/system-preset/90-systemd.preset
|
||||
|
||||
echo "Correcting permissions from overlay..."
|
||||
chown -R root:root $ROOTFS_IMG/rootfs_$ARCH/etc
|
||||
chown -R root:root $ROOTFS_IMG/rootfs_$ARCH/usr/{local,share}
|
||||
if [[ "$EDITION" != "minimal" && "$EDITION" != "server" ]]; then
|
||||
chown root:polkitd $ROOTFS_IMG/rootfs_$ARCH/etc/polkit-1/rules.d
|
||||
chown root:polkitd $ROOTFS_IMG/rootfs_$ARCH/usr/share/polkit-1/rules.d
|
||||
chown -R root:root $TMPDIR/root/etc
|
||||
chown -R root:root $TMPDIR/root/usr/{local,share}
|
||||
if [[ -d $TMPDIR/root/etc/polkit-1/rules.d ]]; then
|
||||
chown root:polkitd $TMPDIR/root/etc/polkit-1/rules.d
|
||||
elif [[ -d $TMPDIR/root/usr/share/polkit-1/rules.d ]]; then
|
||||
chown root:polkitd $TMPDIR/root/usr/share/polkit-1/rules.d
|
||||
elif [[ "$EDITION" = "cubocore" ]]; then
|
||||
cp $TMPDIR/root/usr/share/applications/corestuff.desktop $TMPDIR/root/etc/xdg/autostart/
|
||||
fi
|
||||
|
|
@ -368,14 +369,17 @@ cleanup () {
|
|||
|
||||
# edit boot files and fstab
|
||||
# set UUID for boot partition in fstab
|
||||
BOOT_PARTUUID=$(lsblk -o NAME,PARTUUID | grep ${DEV_NAME}${SDDEV}1 | awk '{print $2}')
|
||||
BOOT_PARTUUID=$(lsblk -p -o NAME,PARTUUID | grep ${DEV_NAME}${SDDEV}1 | awk '{print $2}')
|
||||
sed -i "s/LABEL=BOOT_MNJRO/PARTUUID=$BOOT_PARTUUID/g" $TMPDIR/root/etc/fstab
|
||||
echo "Set boot partition to $BOOT_PARTUUID in /etc/fstab..."
|
||||
|
||||
# Change boot script and fstab to root partition UUID
|
||||
ROOT_PARTUUID=$(lsblk -o NAME,PARTUUID | grep ${DEV_NAME}${SDDEV}2 | awk '{print $2}')
|
||||
ROOT_PARTUUID=$(lsblk -p -o NAME,PARTUUID | grep ${DEV_NAME}${SDDEV}2 | awk '{print $2}')
|
||||
echo "Set root partition to $ROOT_PARTUUID in the relevant boot script and /etc/fstab..."
|
||||
if [ -f $TMPDIR/boot/extlinux/extlinux.conf ]; then
|
||||
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/extlinux/extlinux.conf
|
||||
elif [ -f $TMPDIR/boot/efi/extlinux/extlinux.conf ]; then
|
||||
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PART/g" $TMPDIR/boot/efi/extlinux/extlinux.conf
|
||||
elif [ -f $TMPDIR/boot/boot.ini ]; then
|
||||
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/boot.ini
|
||||
elif [ -f $TMPDIR/boot/uEnv.ini ]; then
|
||||
|
|
@ -383,12 +387,14 @@ cleanup () {
|
|||
elif [ -f $TMPDIR/boot/cmdline.txt ]; then
|
||||
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/boot/cmdline.txt
|
||||
fi
|
||||
echo "Set root partition to $ROOT_PARTUUID in the relevant boot script..."
|
||||
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/root/etc/fstab
|
||||
echo "Set root partition to $ROOT_PARTUUID in /etc/fstab if applicable..."
|
||||
#sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PARTUUID/g" $TMPDIR/root/etc/fstab
|
||||
sync
|
||||
|
||||
|
||||
if [[ "$FSTYPE" = "btrfs" ]]; then
|
||||
sed -i "s/LABEL=ROOT_MNJRO/PARTUUID=$ROOT_PART/g" $TMPDIR/root/etc/fstab
|
||||
else
|
||||
echo "PARTUUID=$ROOT_PARTUUID / $FSTYPE defaults 0 1" >> $TMPDIR/root/etc/fstab
|
||||
fi
|
||||
#clean up
|
||||
if [[ "$FSTYPE" = "btrfs" ]]; then
|
||||
umount $TMPDIR/root/home
|
||||
|
|
@ -401,8 +407,8 @@ cleanup () {
|
|||
cryptsetup close /dev/mapper/ROOT_MNJRO
|
||||
fi
|
||||
fi
|
||||
partprobe $SDCARD 1> /dev/null 2>&1
|
||||
|
||||
partprobe $SDCARD 1> /dev/null 2>&1
|
||||
info "If you get an error stating 'failed to preserve ownership ... Operation not permitted', it's expected, since the boot partition is FAT32 and does not support ownership permissions..."
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue