<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stefc</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stefc"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Stefc"/>
	<updated>2026-04-25T17:00:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Shell_management&amp;diff=20391</id>
		<title>Shell management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Shell_management&amp;diff=20391"/>
		<updated>2021-11-28T12:02:25Z</updated>

		<summary type="html">&lt;p&gt;Stefc: make dir info missed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== Changing the default shell ====&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Download the required package: &amp;lt;br&amp;gt;&#039;&#039;apk add libuser&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you do not have files: /etc/login.defs /etc/default/useradd&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
We will need to create them&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;touch /etc/login.defs&#039;&#039;&lt;br /&gt;
* &#039;&#039;mkdir /etc/default&#039;&#039;&lt;br /&gt;
* &#039;&#039;touch /etc/default/useradd&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Now we can change our default shell&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you want to change the current user&#039;s shell: lchsh&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If you want to change a different user&#039;s shell: lchsh USERNAME&lt;/div&gt;</summary>
		<author><name>Stefc</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Classic_install_or_sys_mode_on_Raspberry_Pi&amp;diff=20390</id>
		<title>Classic install or sys mode on Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Classic_install_or_sys_mode_on_Raspberry_Pi&amp;diff=20390"/>
		<updated>2021-11-27T18:08:22Z</updated>

		<summary type="html">&lt;p&gt;Stefc: effsprogs must be installed early &amp;amp; space before &amp;#039; root&amp;#039; missing for &amp;#039;cmdline.txt&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
A how-to for classic (&amp;quot;sys mode&amp;quot;) installation.&lt;br /&gt;
&lt;br /&gt;
This method works with a desktop PC under Ubuntu and other Linuxes.&lt;br /&gt;
&lt;br /&gt;
= Preparation =&lt;br /&gt;
&lt;br /&gt;
Download the archive from the &#039;&#039;&#039;Rasperry Pi armhf&#039;&#039;&#039; link  [https://alpinelinux.org/downloads/ here].&lt;br /&gt;
&#039;&#039;&#039;Sha256&#039;&#039;&#039; and &#039;&#039;&#039;GPG&#039;&#039;&#039; links appear next to the link to check the download.&lt;br /&gt;
&lt;br /&gt;
Create two partitions on an 8 GB (or larger) class 10 sd-card:&lt;br /&gt;
* First one, a &#039;&#039;&#039;fat16&#039;&#039;&#039; type, of 256MB. You may have to set &amp;lt;code&amp;gt;boot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lba&amp;lt;/code&amp;gt; flags&lt;br /&gt;
* The second one, an &#039;&#039;&#039;ext4&#039;&#039;&#039; type, occupying the remaining space on the media&lt;br /&gt;
&lt;br /&gt;
Eject and re-insert your SD card to ensure recognition of all the partitions.&lt;br /&gt;
&lt;br /&gt;
Go into the first partition (&#039;&#039;&#039;fat16&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Untar the archive with {{pkg|tar}}:&lt;br /&gt;
 tar zxvf ~/Download/alpine-rpi-*-armhf.tar.gz&lt;br /&gt;
&lt;br /&gt;
Due to a bug, it is recommended to add a file named &amp;lt;code&amp;gt;usercfg.txt&amp;lt;/code&amp;gt; into the partition.  The file should contain the following single line:&lt;br /&gt;
&lt;br /&gt;
 enable_uart=1&lt;br /&gt;
&lt;br /&gt;
For headless use, you can add the following parameters to maximize available memory (32 megs is required for the rpi bootloader):&lt;br /&gt;
&lt;br /&gt;
 gpu_mem=32&lt;br /&gt;
&lt;br /&gt;
to enable audio support:&lt;br /&gt;
&lt;br /&gt;
 dtparam=audio=on&lt;br /&gt;
&lt;br /&gt;
Eject the SD card properly. Insert it into the Raspberry Pi. Plug in a usb keyboard as well as the HDMI and network cables. Power on.&lt;br /&gt;
&lt;br /&gt;
When the command prompt displays, log in as root. (no password)&lt;br /&gt;
&lt;br /&gt;
== OSX Preparation: creating a FAT16 partition on microSD ==&lt;br /&gt;
&lt;br /&gt;
To create a FAT16 partition with OSX, use the diskutil program and a USB microSD card reader (I used an older version of this: https://www.bestbuy.com/site/insignia-usb-3-0-memory-card-reader/5787406.p?skuId=5787406).&lt;br /&gt;
&lt;br /&gt;
Put the microSD card in the reader. Connect the reader to a USB port and type &amp;lt;code&amp;gt;ls -1 /Volumes&amp;lt;/code&amp;gt; in a terminal.  Note the name of the microSD volume; for example, VOL1 in the output below:&lt;br /&gt;
  $ ls -1 /Volumes&lt;br /&gt;
  Macintosh HD&lt;br /&gt;
  Preboot&lt;br /&gt;
  VOL1&lt;br /&gt;
  $&lt;br /&gt;
&lt;br /&gt;
Unmount the reader. Disconnect it and re-run &amp;lt;code&amp;gt;ls -1 /Volumes&amp;lt;/code&amp;gt;.  Verify the microSD volume name is no longer listed, then re-insert the USB reader.&lt;br /&gt;
&lt;br /&gt;
Find the mount point of your microSD volume. For example, disk3 in the output below:&lt;br /&gt;
  $ diskutil list VOL1&lt;br /&gt;
  /dev/disk3 (external, physical):&lt;br /&gt;
     #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
     0:     FDisk_partition_scheme                        *31.4 GB    disk3&lt;br /&gt;
     1:                 DOS_FAT_16 VOL1                    256.0 MB   disk3s1&lt;br /&gt;
     2:                      Linux                         30.0 GB    disk3s2&lt;br /&gt;
     3:                 Linux_Swap                         1.2 GB     disk3s3&lt;br /&gt;
  $&lt;br /&gt;
&lt;br /&gt;
(For help with the diskutil command, type &amp;lt;code&amp;gt;diskutil&amp;lt;/code&amp;gt; to list all command verbs.  For help on a specific verb, add the verb. For example, &amp;lt;code&amp;gt;diskutil partitionDisk&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Destroy all the existing partitions on the microSD card and create two new ones: &lt;br /&gt;
# a 256MB, FAT16, DOS-compatible partition and &lt;br /&gt;
# a free space gap for the rest of the card&lt;br /&gt;
&lt;br /&gt;
  $ diskutil partitionDisk disk3 MBR   &amp;quot;MS-DOS FAT16&amp;quot; VOL1 256MB    &amp;quot;Free Space&amp;quot; VOL2 R&lt;br /&gt;
  Started partitioning on disk3&lt;br /&gt;
  Unmounting disk&lt;br /&gt;
  Creating the partition map&lt;br /&gt;
  Waiting for partitions to activate&lt;br /&gt;
  Formatting disk3s1 as MS-DOS (FAT16) with name VOL1&lt;br /&gt;
  512 bytes per physical sector&lt;br /&gt;
  /dev/rdisk3s1: 499472 sectors in 62434 FAT16 clusters (4096 bytes/cluster)&lt;br /&gt;
  bps=512 spc=8 res=1 nft=2 rde=512 mid=0xf8 spf=244 spt=32 hds=32 hid=2 drv=0x80 bsec=500000&lt;br /&gt;
  Mounting disk&lt;br /&gt;
  Finished partitioning on disk3&lt;br /&gt;
  /dev/disk3 (external, physical):&lt;br /&gt;
    #:                       TYPE NAME                    SIZE       IDENTIFIER&lt;br /&gt;
    0:     FDisk_partition_scheme                        *31.4 GB    disk3&lt;br /&gt;
    1:                 DOS_FAT_16 VOL1                    256.0 MB   disk3s1&lt;br /&gt;
  $ &lt;br /&gt;
&lt;br /&gt;
Change your current working directory to the new FAT16 partition then continue with the untar instruction in the parent prep section.&lt;br /&gt;
&lt;br /&gt;
  $ cd /Volumes/VOL1/&lt;br /&gt;
&lt;br /&gt;
= Installation =&lt;br /&gt;
&lt;br /&gt;
Execute the following commands. Make sure there is an internet connection available otherwise setting up the apk mirrors will fail.&lt;br /&gt;
&lt;br /&gt;
 setup-alpine &lt;br /&gt;
&lt;br /&gt;
Set the keyboard map, the timezone, how to connect to the network (&#039;&#039;&#039;dhcp&#039;&#039;&#039; is the best method), say &#039;&#039;&#039;none&#039;&#039;&#039; at &amp;lt;code&amp;gt;save config&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;save cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 apk update&lt;br /&gt;
&lt;br /&gt;
If the extra space in the sd card was left empty, a partition must be created now:&lt;br /&gt;
&lt;br /&gt;
 apk add cfdisk e2fsprogs  # or the tool of your choice&lt;br /&gt;
 cfdisk /dev/mmcblk0       # create the new partition with the free space&lt;br /&gt;
 mkfs.ext4 /dev/mmcblk0p2  # create the ext4 filesystem in the new partition&lt;br /&gt;
&lt;br /&gt;
Raspberry Pi has no hardware clock, so synchronize with an ntp server:&lt;br /&gt;
&lt;br /&gt;
 apk add chrony   &lt;br /&gt;
 service chronyd restart&lt;br /&gt;
&lt;br /&gt;
{{warning | 22 June 2021 - There is currently a bug that causes setup-disk to fail on ext4 mounts on Raspberry Pi. The work around is marked in the instructions below. &amp;lt;br /&amp;gt;[https://gitlab.alpinelinux.org/alpine/aports/-/issues/12353] }}&lt;br /&gt;
&lt;br /&gt;
 mount /dev/mmcblk0p2 /mnt             # The second partition, in ext4 format, where Alpine Linux is installing in sys mode&lt;br /&gt;
 export FORCE_BOOTFS=1                 # work around for issue 12353&lt;br /&gt;
 setup-disk -m sys /mnt&lt;br /&gt;
 mount -o remount,rw /media/mmcblk0p1  # An update in the first partition is required for the next reboot.&lt;br /&gt;
&lt;br /&gt;
You may get some warning about syslinux when you run setup-disk.  You can safely ignore this.&lt;br /&gt;
&lt;br /&gt;
Clean up the boot folder in the first partition to drop unused files:&lt;br /&gt;
&lt;br /&gt;
 rm -f /media/mmcblk0p1/boot/*  &lt;br /&gt;
 cd /mnt       # We are in the second partition &lt;br /&gt;
 rm boot/boot  # Drop the unused symbolink link&lt;br /&gt;
&lt;br /&gt;
Move the image and &amp;lt;code&amp;gt;init ram&amp;lt;/code&amp;gt; for Alpine Linux into the right place:&lt;br /&gt;
&lt;br /&gt;
 mv boot/* /media/mmcblk0p1/boot/  &lt;br /&gt;
 rm -Rf boot&lt;br /&gt;
 mkdir media/mmcblk0p1   # It&#039;s the mount point for the first partition on the next reboot&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry about the error when you execute the following:&lt;br /&gt;
&lt;br /&gt;
 ln -s media/mmcblk0p1/boot boot&lt;br /&gt;
&lt;br /&gt;
Update &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0&amp;quot; &amp;gt;&amp;gt; etc/fstab&lt;br /&gt;
 sed -i &#039;/cdrom/d&#039; etc/fstab   # Of course, you don&#039;t have any cdrom or floppy on the Raspberry Pi&lt;br /&gt;
 sed -i &#039;/floppy/d&#039; etc/fstab&lt;br /&gt;
 cd /media/mmcblk0p1&lt;br /&gt;
&lt;br /&gt;
If you want to activate the edge repository:&lt;br /&gt;
 sed -i &#039;/edge/s/^#//&#039; etc/apk/repositories   # But enable the repository for community if you want vim, mc, php, apache, nginx, etc.&lt;br /&gt;
&lt;br /&gt;
For the next boot, indicate that the root filesystem is on the second partition.  If the cmdline.txt file&lt;br /&gt;
contains a line that starts with &amp;lt;code&amp;gt;/root&amp;lt;/code&amp;gt;, then use sed:&lt;br /&gt;
&lt;br /&gt;
 sed -i &#039;s/$/ root=\/dev\/mmcblk0p2 /&#039; /media/mmcblk0p1/cmdline.txt  &lt;br /&gt;
 reboot&lt;br /&gt;
&lt;br /&gt;
That works on &#039;&#039;&#039;Raspberry Pi 3B&#039;&#039;&#039; and &#039;&#039;&#039;1B&#039;&#039;&#039;, but if you have the &#039;&#039;&#039;1B&#039;&#039;&#039; version, you&#039;ll need to be very, very patient (several tens of minutes).&lt;br /&gt;
&lt;br /&gt;
If a hard disk is connected via &#039;&#039;&#039;usb&#039;&#039;&#039;, you can replace the &amp;lt;code&amp;gt;/dev/mmcblk0p2&amp;lt;/code&amp;gt; above with &amp;lt;code&amp;gt;/dev/sda1&amp;lt;/code&amp;gt;, for example.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to use &#039;&#039;&#039;sed&#039;&#039;&#039;, you can use the nano editor instead, after executing the following command:&lt;br /&gt;
&lt;br /&gt;
 apk add nano&lt;br /&gt;
&lt;br /&gt;
= Post-installation =&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Raspberry Pi (RPI)&#039;&#039;&#039; has no battery to keep the time updated. Therefore, we need to enable the right service to synchronize with an ntp server:&lt;br /&gt;
&lt;br /&gt;
 rc-update del hwclock boot&lt;br /&gt;
 rc-update add swclock boot&lt;br /&gt;
 service hwclock stop&lt;br /&gt;
 service swclock start&lt;br /&gt;
&lt;br /&gt;
Update and upgrade the system:&lt;br /&gt;
&lt;br /&gt;
 apk update&lt;br /&gt;
 apk upgrade&lt;br /&gt;
&lt;br /&gt;
If you want a cool editor ({{Pkg|vim}}), a file manager ({{Pkg|mc}}), and to determine which tasks are running and which services are starting on boot ({{Pkg|htop}}), add the the following packages:&lt;br /&gt;
&lt;br /&gt;
 apk add vim mc htop&lt;br /&gt;
 htop&lt;br /&gt;
 rc-update&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;RPI 3B&#039;&#039;&#039; has wifi on board. To start the service for the encrypted key using wpa2 protocol:&lt;br /&gt;
&lt;br /&gt;
 apk add wpa_supplicant&lt;br /&gt;
 rc-update add wpa_supplicant boot&lt;br /&gt;
 service wpa_supplicant start&lt;br /&gt;
 setup-interfaces &lt;br /&gt;
Replace the IP address by dhcp for all the interfaces if necessary;  select the SSID network for wifi, add the password.&lt;br /&gt;
 ip addr    # to find the IP address for all interfaces&lt;br /&gt;
&lt;br /&gt;
If you want to connect to your RPI via &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt;, an additional user (&#039;&#039;foo&#039;&#039;) and the {{Pkg|sudo}} package are required because it&#039;s forbidden to connect as root:&lt;br /&gt;
&lt;br /&gt;
 apk add sudo&lt;br /&gt;
 adduser foo&lt;br /&gt;
 adduser foo wheel&lt;br /&gt;
 visudo &lt;br /&gt;
&lt;br /&gt;
Uncomment line #82 with &amp;lt;code&amp;gt;wheel ALL=(ALL) ALL&amp;lt;/code&amp;gt;. If {{Pkg|vim}} is installed, save the changes by typing &#039;&#039;&#039;Esc :x&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
Following the preparation instructions for setting up the boot partition as outlined, using the armv7 image (3.10.3), my rpi2 would not even boot, and I was trapped at the dreaded rainbow screen, with the green led blinking a few times in a row, repeatedly.&lt;br /&gt;
&lt;br /&gt;
The rpi2 I had appears to require &#039;&#039;&#039;fat32&#039;&#039;&#039; for the boot partition, NOT &#039;&#039;&#039;fat16&#039;&#039;&#039; as suggested in the instructions.  Use linux fdisk to set the boot partition type as &amp;quot;c&amp;quot; (for fat32/lba) amd set the &#039;&#039;&#039;lba&#039;&#039;&#039; and &#039;&#039;&#039;boot&#039;&#039;&#039; flags for the partition as suggested.  Create the boot partition filesystem as fat32 with:&lt;br /&gt;
&lt;br /&gt;
 mkdosfs -F 32 /dev/sdX1 &lt;br /&gt;
&lt;br /&gt;
Mount and unpacke the tarball to that, and everything should work as documented after the prep instructions.&lt;br /&gt;
&lt;br /&gt;
After booting, you may find less system memory available than you expect.  Currently the Pi requires a minimum of 32 megs of memory for the gpu, to boot unless you have the cut down boot loader installed, in which case you can use 16.  However, you may find more gpu memory is still being used, even if you configure it for less, if you enable audio or camera support.  To find out how your system is actually split:&lt;br /&gt;
&lt;br /&gt;
 apk add raspberrypi&lt;br /&gt;
 /opt/vc/bin/vcgencmd get_mem gpu&lt;br /&gt;
 /opt/vc/bin/vcgencmd get_mem arm&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [[Raspberry Pi]]&lt;br /&gt;
* [[Raspberry Pi 3 - Setting Up Bluetooth]]&lt;br /&gt;
* [[Raspberry Pi 3 - Configuring it as wireless access point -AP Mode]]&lt;br /&gt;
* [[Linux Router with VPN on a Raspberry Pi]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[category: Raspberry]]&lt;/div&gt;</summary>
		<author><name>Stefc</name></author>
	</entry>
</feed>