Bootstrapping Alpine Linux: Difference between revisions
(setup network before setting up repos) |
Localwikifox (talk | contribs) No edit summary |
||
Line 60: | Line 60: | ||
=== Bootloader === | === Bootloader === | ||
=== Notes === | |||
If you have bootstrapped Alpine Linux from an existing system in a different partition and intend to boot into it, you should always include the filesystem module in the kernel parameter (bootloader option), since by default kernel does not automatically load any filesystem modules, unless specified. That way mount will not complain about being unable to mount root partition on /sysroot. | |||
Example bootloader option: | |||
<code>root=UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE rw ext4 vfat</code> | |||
== References == | == References == |
Revision as of 22:09, 5 December 2023
VPS
This section is to provide a means to bootstrap Alpine Linux on any VPS.
Process
Prepare
- Download apk-tools-static for your architecture.
- Unpack .apk
wget https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.0/x86_64/apk.static
tar zxf apk-tools-static-*.apk
Install
Assuming your alpine rootfs is mounted in /tmp/target
sudo ./sbin/apk.static --arch $(arch) -X http://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root /tmp/target --initdb add alpine-base
- edit /tmp/target/etc/fstab
- edit /tmp/target/etc/inittab
- edit /tmp/target/etc/resolv.conf
- mount proc/sys/dev
for a in proc sys dev; do mount -o bind /$a /tmp/target/$a; done
- chroot into your new installation
chroot /tmp/target /bin/sh
- setup hostname
setup-hostname
- setup network
setup-interfaces
- setup repos
setup-apkrepos -f
- add a few base packages
apk update apk add linux-lts linux-firmware-none acpi mkinitfs
- add services to boot
rc-update add acpid default rc-update add bootmisc boot rc-update add crond default rc-update add devfs sysinit rc-update add dmesg sysinit rc-update add hostname boot rc-update add hwclock boot rc-update add hwdrivers sysinit rc-update add killprocs shutdown rc-update add mdev sysinit rc-update add modules boot rc-update add mount-ro shutdown rc-update add networking boot rc-update add savecache shutdown rc-update add seedrng boot rc-update add swap boot
Bootloader
Notes
If you have bootstrapped Alpine Linux from an existing system in a different partition and intend to boot into it, you should always include the filesystem module in the kernel parameter (bootloader option), since by default kernel does not automatically load any filesystem modules, unless specified. That way mount will not complain about being unable to mount root partition on /sysroot.
Example bootloader option:
root=UUID=AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE rw ext4 vfat
References
- Running a Custom Linux Distribution on a Linode
- Run a Custom Compiled Kernel with PV-GRUB
- Replacing non-Alpine Linux with Alpine remotely
- Install Alpine on Amazon EC2
- Install Alpine on coLinux
- Install Alpine on Rackspace
- Alpine setup scripts
- How do I chain boot from grub to syslinux?
- Alpine Linux on Linode
- Installing Alpine Linux in a chroot