With cat /proc/cpuinfo find out your raspberry oi version, check table at: https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
Create boot up disk: https://wiki.alpinelinux.org/wiki/Create_a_Bootable_USB#Format_USB_stick
fdisk /dev/mmcblk0
* d - dele all partiotions
* n - create new partition
* p - primary partition
* 1 - Partition number 1
* Use defaults for first and size +128M
* t Change partition type
* c Partition type (Win95 FAT32/LBA)
* a Make the partition bootable (set boot flag)
* 1 Partition number 1
* n - create new partition
* p - primary partition
* 1 - Partition number 2
* Use defaults for first and last cylinder (just press [Enter] twice).
* w Write your changes to the device
sudo fdisk /dev/mmcblk0 -lDisco /dev/mmcblk0: 1,9 GiB, 1990197248 bytes, 3887104 setores
Unidades: setor de 1 * 512 = 512 bytes
Tamanho de setor (lógico/físico): 512 bytes / 512 bytes
Tamanho E/S (mínimo/ótimo): 512 bytes / 512 bytes
Tipo de rótulo do disco: dos
Identificador do disco: 0x90a51a95
Dispositivo Inicializar Início Fim Setores Tamanho Id Tipo
/dev/mmcblk0p1 * 2048 264191 262144 128M c FAT32 W95 (LBA)
/dev/mmcblk0p2 264192 3887103 3622912 1,7G 83 Linuxsudo mkfs.vfat /dev/mmcblk0p1
sudo mkdosfs -F 32 /dev/mmcblk0p1
sudo mkfs.f2fs -f /dev/mmcblk0p2
sudo mount -t vfat /dev/mmcblk0p1 /mnt/disk
mkdir -p ~/Documentos/raspberrypi/alpine
wget -O ~/Documentos/raspberrypi/alpine/alpine-rpi-3.12.0-armv7.tar.gz http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/armv7/alpine-rpi-3.12.0-armv7.tar.gz
sudo tar -C /mnt/disk --no-same-owner -zxvf ~/Documentos/raspberrypi/alpine/alpine-rpi-3.12.0-armv7.tar.gz
sudo rm /mnt/disk/*-{rpi-b*,rpi-cm*,rpi-zero*,rpi-3*,rpi-4-b,rpi-a*}.dtb
sudo rm /mnt/disk/fixup4.dat
sudo rm /mnt/disk/start4.elf
sudo rm /mnt/disk/boot/*4
su root
cat > /mnt/disk/usercfg.txt <<-EOF
disable_overscan=1
hdmi_drive=2
enable_uart=1
gpu_mem=32
dtparam=audio=on
dtparam=i2s=on
dtoverlay=lirc-rpi:gpio_in_pin=26
dtoverlay=hifiberry-digi
EOF
exitDownload the Alpine for Raspberry Pi tarball - link: http://alpinelinux.org/downloads/
The armv7 build is compatible with Raspberry Pi 2 Model B
Mount the partition /mnt/disk and extract the tarball contents unto it.
Follow instructions here: https://wiki.alpinelinux.org/wiki/Raspberry_Pi
Insert the SD card into the Raspberry Pi and turn it on
- Login into the Alpine system as root. Leave the password empty.
- Type
setup-alpine - Once the installation is complete, commit the changes by typing
lbu commit -d
nano /etc/ssh/sshd_config
Change /sbin/setup-disk to allow f2fs
apk add nano
nano /sbin/setup-diskChange the lines bellow related to f2fs and rpi
.....
supported_boot_fs() {
local supported="ext2 ext3 ext4 btrfs xfs vfat"
[ "$KERNEL_FLAVOR" = "rpi2" ] && supported="$supported f2fs"
local fs=
for fs in $supported; do
[ "$fs" = "$1" ] && return 0
done
echo "$1 is not supported. Only supported are: $supported" >&2
return 1
}
# setup RPI bootloader
setup_rpi() {
local mnt="$1" root="$2" modules="$3" kernel_opts="$4" bootdev="$5"
# need to improve this later
local $bootmedia="/media/mmcblk0p1"
mount -o remount,rw "$bootmedia"
echo "root=$rootdev modules=$modules $kernel_opts" > "$bootmedia"/cmdline.txt
}
.....
install_mounted_root() {
.....
local initfs_features="ata base ide scsi usb virtio"
[ "$KERNEL_FLAVOR" = "rpi2" ] && local initfs_features="base squashfs mmc usb kms dhcp https"
local pvs= dev= rootdev= bootdev= extlinux_raidopt= root= modules=
local kernel_opts="quiet"
[ "$KERNEL_FLAVOR" = "rpi2" ] && kernel_opts="$kernel_opts console=tty1"
.....
modules="sd-mod,usb-storage,${root_fs}${raidmod}"
[ "$KERNEL_FLAVOR" = "rpi2" ] && modules="loop,squashfs,$modules"
.....
case "$BOOTLOADER" in
grub) setup_grub "$mnt" "$root" "$modules" "$kernel_opts" "$bootdev" $disks ;;
syslinux) setup_syslinux "$mnt" "$root" "$modules" "$kernel_opts" "$bootdev" ;;
zipl) setup_zipl "$mnt" "$root" "$modules" "$kernel_opts" ;;
rpi) setup_rpi "$mnt" "$root" "$modules" "$kernel_opts" "$bootdev" $disks ;;
*) die "Bootloader \"$BOOTLOADER\" not supported!" ;;
esac
if [ "$KERNEL_FLAVOR" = "rpi2" ]; then
cat >>"$mnt"/etc/fstab <<-__EOF__
/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0
/media/mmcblk0p1/boot /boot none defaults,bind 0 0
__EOF__
fi
.....
select_bootloader() {
local bootloader=syslinux
if [ "$ARCH" = "ppc64le" ]; then
bootloader=grub-ieee1275
elif [ "$ARCH" = "s390x" ]; then
bootloader=s390-tools
elif [ "$KERNEL_FLAVOR" = "rpi2" ]; then
bootloader=rpi
elif [ -n "$USE_EFI" ]; then
bootloader=grub-efi
elif [ "$BOOTLOADER" = "grub" ]; then
bootloader=grub-bios
fi
echo "$bootloader"
}
# install needed programs
init_progs() {
local raidpkg= lvmpkg= fs= fstools= grub=
[ -n "$USE_RAID" ] && raidpkg="mdadm"
[ -n "$USE_LVM" ] && lvmpkg="lvm2"
for fs in $BOOTFS $ROOTFS $VARFS; do
# we need load btrfs module early to avoid the error message:
# 'failed to open /dev/btrfs-control'
if ! grep -q -w "$fs" /proc/filesystems; then
modprobe $fs
fi
case $fs in
xfs) fstools="$fstools xfsprogs";;
ext*) fstools="$fstools e2fsprogs";;
btrfs) fstools="$fstools btrfs-progs";;
vfat) fstools="$fstools dosfstools";;
f2fs) fstools="$fstools f2fs-tools";;
esac
done
apk add --quiet sfdisk $lvmpkg $raidpkg $fstools $@
}
.....
if [ -d "$1" ]; then
# install to given mounted root
[ "$KERNEL_FLAVOR" = "rpi2" ] && BOOTLOADER=rpi
[ "$BOOTLOADER" = "syslinux" ] && apk add --quiet syslinux
install_mounted_root "${1%/}" \
&& echo "You might need fix the MBR to be able to boot" >&2
exit $?
fiapk add e2fsprogs f2fs-tools
#mkfs.ext4 /dev/mmcblk0p2
mkfs.f2fs /dev/mmcblk0p2
mkdir /stage
mount /dev/mmcblk0p2 /stage
setup-disk -v -o /media/mmcblk0p1/raspberrypi2.apkovl.tar.gz /stage
#echo "/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0" >> /stage/etc/fstab
mount -o remount,rw /media/mmcblk0p1
#sed -i '$ s/$/ root=\/dev\/mmcblk0p2/' /media/mmcblk0p1/cmdline.txt
cp /stage/boot/*-rpi2 /media/mmcblk0p1/boot/
### need to improve and copy contents of '/stage/boot/dtbs-rpi2' into /media/mmcblk0p1
reboot
echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 >> /etc/fstab
apk add haveged
rc-update add haveged boot
mount -o remount,rw /media/mmcblk0p1
cat > /media/mmcblk0p1/usercfg.txt <<-EOF
disable_overscan=1
hdmi_drive=2
enable_uart=1
gpu_mem=32
dtparam=audio=on
dtparam=i2s=on
dtoverlay=lirc-rpi:gpio_in_pin=26
dtoverlay=hifiberry-digi
EOF
lbu commit -dInstall xfce (testing)
setup-xorg-base xfce4 xfce4-terminal lightdm-gtk-greeter xfce4-screensaver dbus-x11 sudo
apk add xf86-input-libinput xf86-video-fbdev
addgroup manager input
addgroup manager video
addgroup root input
addgroup root video
nano /etc/X11/xorg.confSection "Device"
Identifier "Default"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
EndSection
link: https://www.raspberrypi.org/forums/viewtopic.php?t=60569
RPi 1 Model B https://www.raspberrypi.org/forums/viewtopic.php?t=193886
download - http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/armhf/alpine-rpi-3.12.0-armhf.tar.gz