Alpine Linux - como eu defino pacotes para carregar na inicialização?

0

Parece que o Alpine Linux carrega pacotes quando é inicializado. Como adiciono o openssh aos pacotes que são carregados no momento da inicialização?

Quando eu estou logado, eu faço "info apk", que lista 16 pacotes da seguinte forma:

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:~#

As seguintes mensagens do log de inicialização mostram esses 16 pacotes sendo carregados:

* 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.
    
por Duke Dougal 26.10.2016 / 13:03

1 resposta

0

Assumindo que você está inicializando via USB, e você tem o lbu configurado corretamente, depois de instalar o openssh você deve executar:

 lbu commit

Isto salvará o diretório / etc no arquivo de sobreposição apkovl em /media/usb/yourhostname.apkovl.tar.gz

Pacotes instalados na inicialização estão localizados em / etc / apk / world, e quando você salva com "lbu commit" este arquivo também será salvo.

Para o registro, para verificar se o lbu está configurado corretamente (ainda assumindo que você está inicializando via USB), execute:

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

deve retornar:

 LBU_MEDIA=usb
    
por 25.01.2017 / 10:21