Commit 77d4dfc5 authored by Strit's avatar Strit

update to 1.2.6, more in line with manjaro-tools 2.7.0

parent d5d80cae
......@@ -38,16 +38,17 @@ clear && bash manjaro-arm-installer
## Supported Devices:
* Pinebook
* Raspberry Pi 3B
* raspberry Pi 4 (new)
* raspberry Pi 4
* Rock64
* RockPro64
* Odroid C2
* Odroid N2
* Khadas Vim 3 (new)
* Khadas Vim 3
* Rock Pi 4
* Pine64-LTS / Sopine
* Pine64+
* Khadas Vim 1 (new)
* Khadas Vim 1 (new and untested)
* Khadas Vim 2 (new and untested)
## Supported Editions / Desktops:
* Minimal (no xorg, no apps)
......
#! /bin/bash
# *****************************
# Version 1.2.5
# Version 1.2.6
# *****************************
# Set globals
......@@ -121,7 +121,7 @@ getarmprofiles () {
create_install() {
msg "Creating install for $DEVICE..."
msg "Used device is ${SDCARD}${SDDEV}x"
info "Used device is ${SDCARD}${SDDEV}x"
# fetch and extract rootfs
info "Downloading latest $ARCH rootfs..."
......@@ -199,8 +199,6 @@ create_install() {
chown -R root:root $TMPDIR/root/etc 1> /dev/null 2>&1
if [[ "$EDITION" != "minimal" && "$EDITION" != "server" ]]; then
chown root:polkitd $TMPDIR/root/etc/polkit-1/rules.d 1> /dev/null 2>&1
sed -i s/"HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)"/"HOOKS=(base udev autodetect modconf block filesystems keyboard fsck bootsplash-manjaro)"/g $TMPDIR/root/etc/mkinitcpio.conf
$NSPAWN $TMPDIR/root mkinitcpio -P 1> /dev/null 2>&1
fi
info "Doing device specific setups for $DEVICE..."
......@@ -219,11 +217,13 @@ create_install() {
elif [[ "$DEVICE" = "on2" ]]; then
$NSPAWN $TMPDIR/root systemctl disable dhcpcd.service 1> /dev/null 2>&1
echo "LABEL=BOOT /boot vfat defaults 0 0" | tee --append $TMPDIR/root/etc/fstab 1> /dev/null 2>&1
elif [[ "$DEVICE" = "vim1" ]] || [[ "$DEVICE" = "vim3" ]]; then
elif [[ "$DEVICE" = "vim1" ]] || [[ "$DEVICE" = "vim2" ]] || [[ "$DEVICE" = "vim3" ]]; then
echo "LABEL=BOOT /boot vfat defaults 0 0" | tee --append $TMPDIR/root/etc/fstab 1> /dev/null 2>&1
$NSPAWN $TMPDIR/root systemctl enable bluetooth-khadas.service 1> /dev/null 2>&1
elif [[ "$DEVICE" = "pinebook" ]] || [[ "$DEVICE" = "sopine" ]] || [[ "$DEVICE" = "pine64" ]]; then
$NSPAWN $TMPDIR/root systemctl enable pinebook-post-install.service 1> /dev/null 2>&1
sed -i s/"HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)"/"HOOKS=(base udev autodetect modconf block filesystems keyboard fsck bootsplash-manjaro)"/g $ROOTFS_IMG/rootfs_$ARCH/etc/mkinitcpio.conf
$NSPAWN $ROOTFS_IMG/rootfs_$ARCH mkinitcpio -P 1> /dev/null 2>&1
else
echo "No device specific setting needed for $DEVICE"
fi
......@@ -232,6 +232,7 @@ create_install() {
rm $TMPDIR/root/usr/bin/qemu-aarch64-static
rm -rf $TMPDIR/root/var/cache/pacman/pkg/*
rm -rf $TMPDIR/root/var/log/*
rm -rf $ROOTFS_IMG/rootfs_$ARCH/etc/*.pacnew
rm -rf $TMPDIR/root/usr/lib/systemd/system/systemd-firstboot.service
rm -rf $TMPDIR/root/etc/machine-id
......@@ -287,7 +288,7 @@ prepare_card () {
chmod 777 -R $TMPDIR/root
mount ${SDCARD}${SDDEV}1 $TMPDIR/root
elif [[ "$DEVICE" = "on2" ]]; then
elif [[ "$DEVICE" = "on2" ]] || [[ "$DEVICE" = "vim1" ]] || [[ "$DEVICE" = "vim2" ]] || [[ "$DEVICE" = "vim3" ]]; then
# umount SD card
umount ${SDCARD}${SDDEV}1 1> /dev/null 2>&1
umount ${SDCARD}${SDDEV}2 1> /dev/null 2>&1
......@@ -295,32 +296,6 @@ prepare_card () {
#Clear first 8 mb
dd if=/dev/zero of=${SDCARD} bs=1M count=8 1> /dev/null 2>&1
#partition with 2 partitions
parted -s $SDCARD mklabel msdos 1> /dev/null 2>&1
parted -s $SDCARD mkpart primary fat32 0% 256M 1> /dev/null 2>&1
START=`cat /sys/block/$DEV_NAME/${DEV_NAME}1/start`
SIZE=`cat /sys/block/$DEV_NAME/${DEV_NAME}1/size`
END_SECTOR=$(expr $START + $SIZE)
parted -s $SDCARD mkpart primary ext4 "${END_SECTOR}s" 100% 1> /dev/null 2>&1
partprobe $SDCARD 1> /dev/null 2>&1
mkfs.vfat "${SDCARD}${SDDEV}1" -n BOOT 1> /dev/null 2>&1
mkfs.ext4 "${SDCARD}${SDDEV}2" -L ROOT 1> /dev/null 2>&1
#copy rootfs contents over to the FS
mkdir -p $TMPDIR/root
mkdir -p $TMPDIR/boot
mount ${SDCARD}${SDDEV}1 $TMPDIR/boot
mount ${SDCARD}${SDDEV}2 $TMPDIR/root
# For Khadas devices
elif [[ "$DEVICE" = "vim1" ]] || [[ "$DEVICE" = "vim3" ]]; then
# umount SD card
umount ${SDCARD}${SDDEV}1 1> /dev/null 2>&1
umount ${SDCARD}${SDDEV}2 1> /dev/null 2>&1
#Clear first 8 mb
dd if=/dev/zero of=${SDCARD} bs=1M count=8 1> /dev/null 2>&1
#partition with 2 partitions
parted -s $SDCARD mklabel msdos 1> /dev/null 2>&1
parted -s $SDCARD mkpart primary fat32 32M 256M 1> /dev/null 2>&1
......@@ -329,7 +304,7 @@ prepare_card () {
END_SECTOR=$(expr $START + $SIZE)
parted -s $SDCARD mkpart primary ext4 "${END_SECTOR}s" 100% 1> /dev/null 2>&1
partprobe $SDCARD 1> /dev/null 2>&1
mkfs.vfat "${SDCARD}${SDDEV}1" -n BOOT 1>/dev/null 2>&1
mkfs.vfat "${SDCARD}${SDDEV}1" -n BOOT 1> /dev/null 2>&1
mkfs.ext4 "${SDCARD}${SDDEV}2" -L ROOT 1> /dev/null 2>&1
#copy rootfs contents over to the FS
......@@ -411,7 +386,9 @@ cleanup () {
# move boot files
mv $TMPDIR/root/boot/* $TMPDIR/boot
#flash bootloader
dd if=$TMPDIR/boot/u-boot.bin of=${SDCARD} conv=fsync,notrunc bs=512 seek=1 1> /dev/null 2>&1
if [[ "$DEVICE" = "on2" ]]; then
dd if=$TMPDIR/boot/u-boot.bin of=${LDEV} conv=fsync,notrunc bs=512 seek=1 1> /dev/null 2>&1
fi
#clean up
umount $TMPDIR/root
......@@ -420,16 +397,7 @@ cleanup () {
rm -r $TMPDIR/root $TMPDIR/boot
partprobe $SDCARD 1> /dev/null 2>&1
# For Khadas devices
elif [[ "$DEVICE" = "vim1" ]] || [[ "$DEVICE" = "vim3" ]]; then
#clean up
umount $TMPDIR/root
umount $TMPDIR/boot
losetup -d $LDEV 1> /dev/null 2>&1
rm -r $TMPDIR/root $TMPDIR/boot
partprobe $SDCARD 1> /dev/null 2>&1
# For pinebook device
# For pine device
elif [[ "$DEVICE" = "pinebook" ]] || [[ "$DEVICE" = "sopine" ]] || [[ "$DEVICE" = "pine64" ]]; then
#flash bootloader
dd if=$TMPDIR/root/boot/u-boot-sunxi-with-spl-$DEVICE.bin of=${SDCARD} bs=8k seek=1 1> /dev/null 2>&1
......@@ -440,7 +408,7 @@ cleanup () {
partprobe $SDCARD 1> /dev/null 2>&1
# For rockpro64 device
# For rockchip devices
elif [[ "$DEVICE" = "rock64" ]] || [[ "$DEVICE" = "rockpro64" ]] || [[ "$DEVICE" = "rockpi4" ]]; then
#flash bootloader
dd if=$TMPDIR/root/boot/idbloader.img of=${SDCARD} seek=64 conv=notrunc 1> /dev/null 2>&1
......@@ -683,8 +651,8 @@ if [ ! -z "$HOSTNAME" ]; then
Edition = $EDITION
Username = $USER
Additional usergroups = $USERGROUPS
Password for $USER = $PASSWORD
Password for root = $ROOTPASSWORD
Password for $USER = (password hidden)
Password for root = (password hidden)
SD Card = $SDCARD
Timezone = $TIMEZONE
Locale = $LOCALE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment