0

It seems that Alpine Linux loads packages up when it boots. How do I add openssh to the packages that are loaded at boot time?

When I am logged in I do "apk info" which lists 16 packages as follows:

localhost:~# apk info
musl
busybox
alpine-baselayout
openrc
alpine-conf
zlib
libcrypto1.0
libssl1.0
apk-tools
busybox-suid
busybox-initscripts
scanelf
musl-utils
libc-utils
alpine-keys
alpine-base
localhost:~#

The following messages from the boot log show these 16 packages being loaded:

* Installing packages to root filesystem: (1/16) Installing musl (1.1.14-r12)
7  0% [                                           ][    3.787784] tsc: Refined TSC clocksource calibration: 2600.002 MHz
[    3.788821] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x257a3e40e8d, max_idle_ns: 440795298933 ns
8[0K(2/16) Installing busybox (1.24.2-r11)
7  7% [###                                        ]8[0K7 17% [#######                                    ]8[0KExecuting busybox-1.24.2-r11.post-install
(3/16) Installing alpine-baselayout (3.0.3-r0)
7 18% [########                                   ]8[0KExecuting alpine-baselayout-3.0.3-r0.pre-install
7 18% [########                                   ]8[0K7 19% [########                                   ]8[0K7 20% [########                                   ]8[0KExecuting alpine-baselayout-3.0.3-r0.post-install
(4/16) Installing openrc (0.21-r2)
7 23% [##########                                 ]8[0K7 24% [##########                                 ]8[0K7 25% [##########                                 ]8[0K7 25% [###########                                ]8[0K7 26% [###########                                ]8[0K7 27% [###########                                ]8[0K7 28% [############                               ]8[0K7 29% [############                               ]8[0K7 30% [############                               ]8[0K7 30% [#############                              ]8[0K7 31% [#############                              ]8[0K7 32% [#############                              ]8[0K7 32% [##############                             ]8[0K7 33% [##############                             ]8[0K7 34% [##############                             ]8[0K7 35% [###############                            ]8[0K7 36% [###############                            ]8[0K7 37% [###############                            ]8[0K7 37% [################                           ]8[0K7 38% [################                           ]8[0K7 39% [################                           ]8[0K7 39% [#################                          ]8[0K7 40% [#################                          ]8[0K7 41% [#################                          ]8[0K7 42% [##################                         ]8[0K7 43% [##################                         ]8[0K7 44% [##################                         ]8[0K7 44% [###################                        ]8[0K7 45% [###################                        ]8[0K7 46% [###################                        ]8[0K7 46% [####################                       ]8[0K7 47% [####################                       ]8[0KExecuting openrc-0.21-r2.post-install
(5/16) Installing alpine-conf (3.4.1-r5)
7 49% [#####################                      ]8[0K7 50% [#####################                      ]8[0K7 51% [#####################                      ]8[0K7 51% [######################                     ]8[0K(6/16) Installing zlib (1.2.8-r2)
7 52% [######################                     ]8[0K(7/16) Installing libcrypto1.0 (1.0.2j-r0)
7 53% [######################                     ]8[0K7 80% [##################################         ]8[0K7 81% [###################################        ]8[0K7 82% [###################################        ]8[0K7 83% [###################################        ]8[0K7 83% [####################################       ]8[0K7 84% [####################################       ]8[0K7 85% [####################################       ]8[0K(8/16) Installing libssl1.0 (1.0.2j-r0)
7 85% [####################################       ]8[0K(9/16) Installing apk-tools (2.6.7-r0)
7 91% [#######################################    ]8[0K(10/16) Installing busybox-suid (1.24.2-r11)
7 94% [########################################   ]8[0K(11/16) Installing busybox-initscripts (3.0-r3)
7 94% [########################################   ]8[0K7 95% [########################################   ]8[0K7 95% [#########################################  ]8[0K7 96% [#########################################  ]8[0KExecuting busybox-initscripts-3.0-r3.post-install
(12/16) Installing scanelf (1.1.6-r0)
7 96% [#########################################  ]8[0K(13/16) Installing musl-utils (1.1.14-r12)
7 97% [########################################## ]8[0K7 98% [########################################## ]8[0K(14/16) Installing libc-utils (0.7-r0)
7 99% [########################################## ]8[0K(15/16) Installing alpine-keys (1.1-r0)
7 99% [########################################## ]8[0K(16/16) Installing alpine-base (3.4.4-r0)
7 99% [########################################## ]8[0K7100% [###########################################]8[0KExecuting busybox-1.24.2-r11.trigger
OK: 7 MiB in 16 packages
ok.
0

Assuming that you are booting via USB, and you have lbu properly configured, after you install openssh you should run:

 lbu commit

This will save the /etc dir in the apkovl overlay file in /media/usb/yourhostname.apkovl.tar.gz

Packages installed on boot are located in /etc/apk/world, and when you save with "lbu commit" this file will be saved as well.

For the record, to check if lbu is properly configured, (still assuming that you are booting via USB), run:

 cat /etc/lbu/lbu.conf | grep LBU_MEDIA

it should return:

 LBU_MEDIA=usb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.