Skip to content

1.10 #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

1.10 #147

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ After reboot, few final steps may be made to improve further the final image, ma
- Set a wallpaper
- Edit `/boot/cmdline.txt` replacing the default content with
```
root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw rootwait console=serial0,115200 console=tty1 fsck.repair=yes
root=UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX rw rootwait console=serial0,115200 console=tty1 fsck.repair=yes plymouth.ignore-serial-consoles video=HDMI-A-1:1920x1080@60D
```
- start Kstars without acknowledging any message, start ekos simulator, go to the guiding tab and download the most common indexes
- enable the resize script to do its magic on the user's first boot - run `sudo systemctl enable resize_once`
Expand All @@ -104,3 +104,20 @@ Using `pishrink` follow these steps:
- `sudo ./pishrink.sh -za astroarch.img astroarch-X.X.X.img.gz`

the gzipped image is ready to be distributed and can be flashed on other media

## Building with an AstroArch script from an existing AstroArch version
## (according to this description https://wiki.archlinux.org/title/Install_Arch_Linux_from_existing_Linux)

Copy the AA_build_fromAA.sh and astroarch_build_chroot.sh files from the GitHub site https://github.com/sc74/astroarch/tree/1.10/build-astroarch to your Home directory

Make them executable with the command chown +x followed by the file name. Mount a drive or disk and simply run the command AA_build_fromAA.sh

The script will simply ask you which device you want to install on and the password for astronaut

At the end of the process, you will have a working installation on your device and an image to install on another device

The scripts are easily modifiable to create your own AstroArch. The first script allows you to pass the files needed for the build

The second builds the OS. You can add packages, services, and any other files to customize your setup


18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ this likely means that unfortunately your raspberry pi rev cannot boot the image
Once you are logged in the first thing you should do is update the system, open the terminal and type `update-astroarch` command

# Set timezone
Do not forget to set the right timezone! to do so run `sudo timedatectl set-timezone Foo/Bar` where Foo/Bar is something like `Europe/Rome`
Here a small video that will show you how to set the timezone without the terminal

https://github.com/devDucks/astroarch/assets/4163222/a935b491-5b7a-444d-9f89-a01a279063de

If you want to use the terminal list first the available timezone with `timedatecl list-timezones` and then set the right one with `tsudo timedatectl set-timezone Foo/Bar` where Foo/Bar is something like `Europe/Rome`

Do not forget to set the right timezone!

# Passwords
To save you some time, here the default password you will need for AstroArch:
Expand Down Expand Up @@ -97,6 +103,8 @@ The followings are some useful commands that you can run from the terminal so yo
- `use-astro-bleeding-edge` => install bleeding edge packages for Kstars and INDI
- `use-astro-stable` => install stable packages for Kstars and INDI

The AstroArch Tweak Tool utility allows you to easily run all these commands

# Connecting via browser (noVNC)
By default `AstroArch` will start a hostpot called `AstroArch`, to connect to that WiFi network use the password `astronomy`

Expand Down Expand Up @@ -233,9 +241,11 @@ ADDITIONAL CONSIDERATIONS (use these as guidelines):
If you are having trouble getting the signal, you may need to protect your USB3 cables (they interfere with the GPS signal)
if the device is not recognized (which is very unlikely on ArchLinux), we do not recommend using ttyXXX as it may point to other serial devices after a reboot

These commands are in the AstroArch Tweak Tool utility

# How to enable bluetooth
By default there are no packages to enabling bluetooth, to install them and enabling bluetooth functionalities run the following command `bluetooth_on`, this command will install the BT packages and enable the bluetooth daemon to run automatically at boot.
If you want to disable bluetooth daemon autostart just run `bluetooth_off` and if you want to remove it run `bluetooth_remove`
If you want to disable bluetooth daemon autostart just run `bluetooth_off` and if you want to remove it run `bluetooth_remove`. These commands are in the AstroArch Tweak Tool utility

# How to enable FTP
Identical to Bluetooth, there is no default package to activate an FTP server.
Expand All @@ -244,7 +254,9 @@ To install and activate it, run the following command `ftp_on`. This command wil

To connect from a remote station, use an FTP client such as FileZilla or other. All you need to do is identify yourself with the astronaut user, his password and the IP address where the server is located. You will easily find the IP address of your LAN or WLAN with the ifconfig command in a console. Once connected, you can very quickly transfer your files in both directions.

If you want to disable the automatic start of the FTP server, simply run `ftp_off` and if you want to remove it, run `ftp_remove`.
If you want to disable the automatic start of the FTP server, simply run `ftp_off` and if you want to remove it, run `ftp_remove`.

These commands are in the AstroArch Tweak Tool utility

# Where to find more packages?
If you want to install more packages you should look what is available here https://archlinuxarm.org/packages - if you find the package there you can easily install it running `sudo pacman -S PACKAGE_NAME`,
Expand Down
21 changes: 10 additions & 11 deletions astroarch_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ set -e
# Grab the OS architecture for further forked logic
ARCH=$(uname -m)

# Parallelize pacman download to 5 and use pacman as progress bar
sed -i 's|#ParallelDownloads = 5|ParallelDownloads=5\nILoveCandy\n|g' /etc/pacman.conf
# Parallelize pacman download to 5
# Use pacman as progress bar
# Disable timeout on downloads (slow mirrors)
sed -i 's|#ParallelDownloads = 5|ParallelDownloads=5\nILoveCandy\nDisableDownloadTimeout\n|g' /etc/pacman.conf

# Add astroarch pacman repo to pacman.conf (it must go first)
sed -i 's|\[core\]|\[astromatto\]\nSigLevel = Optional TrustAll\nServer = http://astroarch.astromatto.com:9000/$arch\n\n\[core\]|' /etc/pacman.conf
Expand Down Expand Up @@ -44,7 +46,7 @@ pacman -Syu base-devel pipewire-jack gnu-free-fonts wireplumber \
ksystemlog discover kwalletmanager kgpg qt5-serialbus \
qt5-serialport qt5ct udisks2-qt5 xorg-fonts-misc fuse2 \
fortune-mod cowsay pacman-contrib arandr neofetch \
astromonitor kscreen sddm-kcm flatpak --noconfirm --ask 4
astromonitor kscreen sddm-kcm flatpak ckbcomp astroarch-onboarding kdialog --noconfirm --ask 4

# Allow wheelers to sudo without password to install packages
sed -i 's/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/g' /etc/sudoers
Expand Down Expand Up @@ -99,6 +101,7 @@ ln -s /home/astronaut/.astroarch/systemd/novnc.service /usr/lib/systemd/system/n
ln -s /home/astronaut/.astroarch/systemd/x0vncserver.service /etc/systemd/system/x0vncserver.service
ln -s /home/astronaut/.astroarch/systemd/resize_once.service /etc/systemd/system/resize_once.service
ln -s /home/astronaut/.astroarch/configs/.astroarch.version /home/astronaut/.astroarch.version
ln -s /home/astronaut/.astroarch/systemd/astroarch-onboarding.service /etc/systemd/system/astroarch-onboarding.service

# Copy xorg config
cp /home/astronaut/.astroarch/configs/xorg.conf /etc/X11/
Expand All @@ -121,10 +124,6 @@ su astronaut -c "cp /home/astronaut/.astroarch/configs/kwinrc /home/astronaut/.c
# Enable now all services
systemctl enable sddm.service novnc.service dhcpcd.service NetworkManager.service avahi-daemon.service nmb.service smb.service

# Take sudoers to the original state
sed -i 's/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/g' /etc/sudoers
sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/g' /etc/sudoers

# Copy wallpapers
su astronaut -c "cp /home/astronaut/.astroarch/wallpapers/bubble.jpg /home/astronaut/Pictures/wallpapers"
su astronaut -c "cp /home/astronaut/.astroarch/wallpapers/south-milky.jpg /home/astronaut/Pictures/wallpapers"
Expand Down Expand Up @@ -153,17 +152,17 @@ su astronaut -c "cp /home/astronaut/.astroarch/configs/kscreenlockerrc /home/ast
timedatectl set-timezone Europe/London

# If we are on a raspberry let's adjust /boot/config.txt
sed -i 's/max_framebuffers=2/max_framebuffers=2\nframebuffer_depth=24/g' /boot/config.txt
sed -i 's/dtoverlay=vc4-kms-v3d/dtoverlay=vc4-kms-v3d,cma-512/g' /boot/config.txt
echo dtparam=i2c_arm=on >> /boot/config.txt
echo dtparam=audio=on >> /boot/config.txt
echo disable_overscan=1 >> /boot/config.txt
echo gpu_mem=256 >> /boot/config.txt
echo disable_splash=1 >> /boot/config.txt
echo 3dtparam=krnbt=on >> /boot/config.txt
echo hdmi_drive=2 >> /boot/config.txt
echo dtoverlay=i2c-rtc >> /boot/config.txt
echo kernel=kernel8.img >> /boot/config.txt
echo hdmi_enable_4kp60=1 >> /boot/config.tx
echo i2c-dev > /etc/modules-load.d/raspberrypi.conf
sed -i 's/dtoverlay=vc4-kms-v3d/dtoverlay=vc4-fkms-v3d/g' /boot/config.txt
sed -i 's/max_framebuffers=2/max_framebuffers=2\nframebuffer_depth=24/g' /boot/config.txt

# Pi5 only settings should go here
echo [pi5] >> /boot/config.txt
Expand Down
106 changes: 106 additions & 0 deletions build-astroarch/AA_build_fromAA.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/bin/bash
# Exit on the first error, if any

set -e

# Grab the OS architecture for further forked logic
ARCH=$(uname -m)

#paru -S pishrink-git

# Choose disk to write and prepare
count=0
IFS=$'\n'
for device_info in `lsblk -d -n -o NAME,TYPE,SIZE`; do
count=$((count+1))
device_name=$(echo $device_info | cut -d" " -f1)
dev[$count]=$device_name
printf '%s: %s\n' "$count" "$device_info"
done

read -rp "Select disk (numbers 1-$count): " selection

DISK="/dev/${dev[$selection]}"
PART1="$DISK"1""
PART2="$DISK"2""

echo "Installing on $DISK"
echo "Are you sure ?"
read -p "Press enter to continue"
echo
echo "Erase disk $DISK"
read -p "Press enter to continue"
sudo -S dd if=/dev/zero of=$DISK bs=440 count=1 status=progress
echo
echo "Make partitions on $DISK"
#read -p "Press enter to continue"
(
echo p;
echo o;
echo n;
echo ;
echo ;
echo ;
echo +537M;
echo t;
echo 0c;
echo a;
echo n;
echo ;
echo ;
echo ;
echo ;
echo w;
) | sudo fdisk $DISK
echo
echo "Format partitions on $DISK"
#read -p "Press enter to continue"
sudo mkfs.vfat -n 'BOOT' $PART1
echo y | sudo mkfs.ext4 $PART2
echo "done"


# Create folder and mount
echo "Create folder root"
if [ ! -d ~/root ]; then
mkdir ~/root
fi
echo "Mount partitions in folder"
#read -p "Press enter to continue"
sudo mount $PART2 ~/root
if [ ! -d ~/root/boot ]; then
sudo mkdir ~/root/boot
fi
sudo mount $PART1 ~/root/boot
echo 'astro' | sudo -S echo ''
# Copy some files in chroot
echo $DISK > diskchroot
sudo cp ~/diskchroot ~/root
echo 'astro' | sudo -S echo ''
sudo mkdir -p ~/root/kstars/astronomy/
sudo cp ~/.local/share/kstars/astrometry/* ~/root/kstars/astronomy/
echo 'astro' | sudo -S echo ''
sudo cp astroarch_build_chroot.sh /home/astronaut/root
echo 'astro' | sudo -S echo ''
# Install base
echo "Install ArchLinux base"
#read -p "Press enter to continue"
# sudo pacstrap -K ~/root base base-devel linux-rpi linux-rpi-headers linux-firmware-whence linux-firmware linux-api-headers archlinuxarm-keyring
sudo pacstrap -K ~/root base linux-rpi linux-firmware base-devel linux-api-headers archlinuxarm-keyring
echo 'astro' | sudo -S echo ''
# Enter chroot and install AstroArch
echo "arch-chroot : install AstroArch"
#read -p "Press enter to continue"
sudo -S arch-chroot ~/root /astroarch_build_chroot.sh
echo 'astro' | sudo -S echo ''
# Umount disk and delete folder
echo "umount" $DISK
sudo umount -l $PART1
sudo umount -l $PART2
echo "delete folder root"
sudo rm -R ~/root
echo 'astro' | sudo -S echo ''
echo "create image astroarch"
sudo dd if=$DISK of=astroarch.img bs=8M status=progress
echo 'astro' | sudo -S echo ''
sudo pishrink.sh -za astroarch.img astroarch-X.X.X.img.gz
Loading