Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpine Linux? #47

Closed
justinkelly opened this issue Feb 13, 2018 · 21 comments
Closed

Alpine Linux? #47

justinkelly opened this issue Feb 13, 2018 · 21 comments

Comments

@justinkelly
Copy link

HI TermuxArch

Just wondering if there is any chance of getting Alpine Linux available for Termux?

Reason I ask is for the very minimal size of Alpine - which is suitable to the limted space of chromebooks

Cheers

Justin

@SDRausty
Copy link
Owner

SDRausty commented Feb 15, 2018

Hello @justinkelly

Thanks for sharing these thoughs about Alpine Linux. Alpine uses sha256sum. This wants implementation for Alpine to work in TermuxArch otherwise you could use bash setupTermuxArch.sh --manual and simply specify the image to use.

Try ./setupTermuxArch.sh --bloom and see whether hacking the code to use sha256sum instead of md5sum for the download Alpine image works. Use ./setupTermuxArch --run to use the setup scripts from ~/TermuxArchBloom which is created by ./setupTermuxArch.sh --bloom.

Happy sailing ⛵

@justinkelly
Copy link
Author

thanks @SDRausty for the reply - i'll try that and see how it goes

@SDRausty
Copy link
Owner

SDRausty commented Oct 3, 2018

@justinkelly here is an update. I am working on setupTermuxArch.sh o customdir; This option is about Linux flavors. You should be able to login with ./customdir/statarch+customdir r ash for Alpine Linux after installing (<2M download). Would you care to review this new option which is being constructed?

@gauloics
Copy link

gauloics commented Oct 3, 2018

oh I failed to use setupTermuxArch.sh o alp, and alp only had a tmp folder, what's wrong?

@SDRausty
Copy link
Owner

SDRausty commented Oct 3, 2018

@gauloics try this, since option is being developed, and only curl is implemented at present:

$ ./setupTermuxArch.sh c o alp

Setting `curl` as download manager.
Setting mode to option.
Checking prerequisites…

Using curl to manage downloads.

 🕛 > 🕧 Prerequisites: OK  Downloading TermuxArch…

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   153  100   153    0     0    281      0 --:--:-- --:--:-- --:--:--   280
100 37708  100 37708    0     0  85700      0 --:--:-- --:--:-- --:--:-- 85700

 🕛 > 🕐 TermuxArch download: OK

 🕛 > 🕜 TermuxArch v1.6.3.id0492 integrity: OK

This option to install Linux flavors is under development;

Choose one of these option by inputting a number to continue:

1) Alpine      3) Debian      5) Parabola    7) Ubuntu
2) Arch Linux  4) Fedora      6) Slackware
#? 1

You selected Alpine which is option 1

TermuxArch: FREE SPACE WARNING!  Start thinking about cleaning out some stuff.  1270716 1K-blocks of free user space is available on this device.  The recommended minimum to install Arch Linux in Termux PRoot for aarch64 is 1.5G of free user space.

Setting locales to: Language >> en_US << Region

 🕛 > 🕝 Detected aarch64 GNU/Linux operating system.

 🕛 > 🕒 Activating wake-lock: DONE

 🕛 > 🕓 Downloading the checksum file and alpine-minirootfs-3.8.1-aarch64.tar.gz  from http://dl-cdn.alpinelinux.org…  This may take a long time pending connection.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   105  100   105    0     0   8750      0 --:--:-- --:--:-- --:--:--  8750
100 1991k  100 1991k    0     0  58.9M      0 --:--:-- --:--:-- --:--:-- 58.9M

 🕛 > 🕠 Checking download integrity with Termux busybox md5sum.  This may take a little while:

 🕛 > 🕕 System image file download integrity: OK

 🕛 > 🕡 Unpacking alpine-minirootfs-3.8.1-aarch64.tar.gz into /data/data/com.termux/files/home/alp.  The option to create Arch Linux system users is available through addauser.  Arch Linux user login from Termux with startarch+alp is now implemented.  See Ability for Scripts to Launch Commands for Arch Linux in Termux PRoot on Device https://github.com/sdrausty/TermuxArch/issues/54 for more information about these brand new options.

While waiting, you can use df, du -hs, htop, ps, top and watch in a new Termux session to watch the unpacking while the session completes.  Use info query and man query to learn more about your Linux system in the palm of your hand.  See The Linux Documentation Project http://tldp.org to learn more about Linux and CLI commands.  Unpacking alpine-minirootfs-3.8.1-aarch64.tar.gz will take a long time; Be patient…


 🕛 > 🕘 Cleaning up installation files: DONE

 🕛 > 🕤 Arch Linux in Termux PRoot is installed.  Configuring and updating Arch Linux 📲sed: /data/data/com.termux/files/home/alp/etc/pacman.d/mirrorlist: No such file or directory
sed: /data/data/com.termux/files/home/alp/etc/pacman.d/mirrorlist: No such file or directory

 TermuxArch WARNING:  Generated script signal 1 near or at line number 92 by `sed -i -e 1,4d "$INSTALLDIR"/etc/pacman.d/mirrorlist`!

setupTermuxArch.sh c o alp v1.6.3.id0492: [Exit Signal 201] DONE 🏁

$ ./alp/startarch+alp r ash
/data/data/com.termux/files/home # whoami
root
/data/data/com.termux/files/home #

Use setupTermuxArch.sh c o alp for now. As TermuxArch only configures for ArchLinux, use the init file in the root directory of the installation and add the raw option followed by ash. Then use apk to add bash:

$ ./alp/startarch+alp r ash
/data/data/com.termux/files/home # apk add bash

Now the init file will start without options:

$ ./alp/startarch+alp 
Welcome to Arch Linux in Termux!
Install a package: pacman -S package
More  information: pacman -[D|F|Q|R|S|T|U]h
Search   packages: pacman -Ss query
Upgrade  packages: pacman -Syu

Chat: wiki.termux.com/wiki/Community
Help: info query and man query
IRC:  wiki.archlinux.org/index.php/IRC_channel

[root17:27home]$ whoami
root
[root17:28home]$ apk
apk-tools 2.10.1, compiled for aarch64.

Installing and removing packages:
  add       Add PACKAGEs to 'world' and install (or upgrade) them,
            while ensuring that all dependencies are met
  del       Remove PACKAGEs from 'world' and uninstall them

System maintenance:
  fix       Repair package or upgrade it without modifying main
            dependencies
  update    Update repository indexes from all remote repositories
  upgrade   Upgrade currently installed packages to match
            repositories
  cache     Download missing PACKAGEs to cache and/or delete
            unneeded files from cache

Querying information about packages:
  info      Give detailed information about PACKAGEs or
            repositories
  list      List packages by PATTERN and other criteria
  dot       Generate graphviz graphs
  policy    Show repository policy for packages

Repository maintenance:
  index     Create repository index file from FILEs
  fetch     Download PACKAGEs from global repositories to a local
            directory
  verify    Verify package integrity and signature
  manifest  Show checksums of package contents

Use apk <command> --help for command-specific help.
Use apk --help --verbose for a full command listing.

This apk has coffee making abilities.
[root17:28home]$

Enjoy 🎑

@gauloics
Copy link

gauloics commented Oct 3, 2018

I canceled it because it didn't download alpine images

$ bash setupTermuxArch.sh c o alp
Setting curl as download manager.
Setting mode to option.
Checking prerequisites…
Using curl to manage downloads.
🕛 > 🕧 Prerequisites: OK Downloading TermuxArch…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 153 100 153 0 0 81 0 0:00:01 0:00:01 --:--:-- 81
100 37708 100 37708 0 0 98454 0 --:--:-- --:--:-- --:--:-- 736k
🕛 > 🕐 TermuxArch download: OK
🕛 > 🕜 TermuxArch v1.6.3.id0492 integrity: OK
This option to install Linux flavors is under development;
Choose one of these option by inputting a number to continue:

  1. Alpine 3) Debian 5) Parabola 7) Ubuntu
  2. Arch Linux 4) Fedora 6) Slackware
    #? 1
    You selected Alpine which is option 1
    Setting locales to: Language >> en_US << Region
    🕛 > 🕝 Detected x86_64 Android operating system.
    🕛 > 🕒 Activating wake-lock: DONE
    🕛 > 🕞 Downloading checksum from http://archive.archlinux.org…
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 185 100 185 0 0 132 0 0:00:01 0:00:01 --:--:-- 132
    100 220 100 220 0 0 97 0 0:00:02 0:00:02 --:--:-- 964
    🕛 > 🕓 Downloading archlinux-bootstrap-2017.03.01-i686.tar.gz from http://archive.archlinux.org… This may take a long time pending connection.

@SDRausty
Copy link
Owner

SDRausty commented Oct 3, 2018

I canceled it because it didn't download alpine images

Option Flavors is not implemented for all systems from the command line at present. Try setupTermuxArch.sh bloom and edit line 595 SPECS_X86_=( [DIST]="$CSYSTEM" [FILE]="" [PROTOCOL]="https" [RPATH]="/iso/2017.03.01/" [SITE]="archive.archlinux.org" [SFNM]="md5sums.txt" [STYPE]="md5sum" ) https://github.com/sdrausty/TermuxArch/blob/master/setupTermuxArch.sh#L595 use https://github.com/sdrausty/TermuxArch/blob/master/espritfunctions.sh#L239&&#L265 for additional image information.

@gauloics
Copy link

gauloics commented Oct 3, 2018

I have tried editing fike but same, still download archlinux bootstrap
screenshot_2018-10-04-01-23-19

I have tried installing alpine termux by Hax4us, it works but has a busybox problem after running updrade, or after installing the package, even though I didn't upgrade before. Maybe it's because Alpine doesn't support i686

@SDRausty
Copy link
Owner

SDRausty commented Oct 3, 2018

@gauloics I am working on implementing setupTermuxArch.sh manual option [customdir]. In the meantime you can try editing knownconfigurations.sh in TermuxArchBloom or the repository root directory to see whether changing these values from https://alpinelinux.org/downloads/ have a better effect. Update before editing. Share your error. This should help in development.

(4/5) Installing readline (7.0.003-r0)
(5/5) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
Executing busybox-1.28.4-r1.trigger
OK: 13 MiB in 18 packages
/data/data/com.termux/files/home # e
/bin/ash: e: not found
/data/data/com.termux/files/home # exit
$ startarch c addauser user
/bin/bash: /root/bin/addauser: /bin/env: bad interpreter: No such file or directory
$ startarch

Welcome to Arch Linux in Termux!
Install a package: pacman -S package
More  information: pacman -[D|F|Q|R|S|T|U]h
Search   packages: pacman -Ss query
Upgrade  packages: pacman -Syu

Chat: wiki.termux.com/wiki/Community
Help: info query and man query
IRC:  wiki.archlinux.org/index.php/IRC_channel

[root19:17home]$ add
add-shell  addauser   addgroup   adduser
[root19:17home]$ addauser user
bash: /root/bin/addauser: /bin/env: bad interpreter: No such file or directory
[root19:17home]$

Maybe it's because Alpine doesn't support i686

Your architecture is fully supported. What do you think about naming this brand new option Flavors?

@gauloics
Copy link

gauloics commented Oct 4, 2018

where do I actually change the file? Sorry about my stupid question 😂. I am stuck in this.

knownconfigurations.sh: line 87: DIST: unbound variable
setupTermuxArch.sh manual alp v1.6.3.id0492: [Exit Signal 1] DONE 🏁

@SDRausty
Copy link
Owner

SDRausty commented Oct 4, 2018

where do I actually change the file?

  1. bash-4.4$ ./setupTermuxArch.sh c m f alpinedir will create setupTermuxArchConfigs.sh and install Alpine.
  2. I think you should edit _X86_ in setupTermuxArchConfigs.sh. Please confirm your architecture. Use _EXAMPLE_ as a guide.
  3. bash-4.4$ ./alpinedir/startarch+alpinedir r ash will access Alpine. Use apk add bash to add bash in Alpine, and your good to go with startarch+alpinedir login.

@gauloics
Copy link

gauloics commented Oct 5, 2018

🕛 > 🕛 TermuxArch v1.6.3.id0492 shall attempt to install Linux in /data/data/com.termux/files/home/f. Linux in Termux PRoot shall be available upon successful completion. To run this BASH script again, use !!. Ensure background data is not restricted. Check the wireless connection if you do not see one o'clock 🕐 below. Checking prerequisites…
Using curl to manage downloads.
🕛 > 🕧 Prerequisites: OK Downloading TermuxArch…
🕛 > 🕑 TermuxArch configuration /data/data/com.termux/files/home/TermuxArchBloom/setupTermuxArchConfigs.sh loaded: OK
Setting locales to: Language >> en_US << Region
🕛 > 🕝 Detected x86_64 Android operating system.
🕛 > 🕒 Activating wake-lock: DONE
🕛 > 🕞 Downloading checksum from http://dl-cdn.alpinelinux.org…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2159k 100 2159k 0 0 384k 0 0:00:05 0:00:05 --:--:-- 521k
TermuxArch WARNING: Generated script signal 201 near or at line number 100 by file="$(grep i686 $SRMFILE | awk {'print $2'})"!
setupTermuxArch.sh c m f alpinedir v1.6.3.id0492: [Exit Signal 201] DONE 🏁

@SDRausty
Copy link
Owner

SDRausty commented Oct 5, 2018

@justinkelly @gauloics since we are going to be dealing with more than one operating system install possibility, this has triggered a major rewrite of TermuxArch🎑✨ If all goes well, the "major rewrite" shall be swift and small. The database additions might also be so; Even though there are many flavors of the Linux OS, most appear to condense to just a few branches of Linux (or is it trees?)

@SDRausty
Copy link
Owner

SDRausty commented Oct 6, 2018

dealing with more than one operating system

This extends to image retrieval too. Slackware wants an ftp connection for arm architecture images. FTP is not available in TermuxArch currently. Hopefully, ftp be available soon.

@SDRausty
Copy link
Owner

SDRausty commented Oct 6, 2018

wondering if there is any chance of getting Alpine Linux available

@justinkelly this f4b2685 commit makes Alpine Linux available in TermuxArch.

@SDRausty
Copy link
Owner

SDRausty commented Oct 8, 2018

I am getting quite a few:

[proot03:17working]$ apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/aarch64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/main: temporary error (try again later)
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/aarch64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/community: temporary error (try again later)
v3.8.1-22-g24d67bab3a [http://dl-cdn.alpinelinux.org/alpine/v3.8/main]
v3.8.1-16-g96e1e57fed [http://dl-cdn.alpinelinux.org/alpine/v3.8/community]
2 errors; 9361 distinct packages available
[proot03:17working]$

How about you?

@gauloics
Copy link

gauloics commented Oct 8, 2018

#128 (comment)

fix md5sum error first, please...

@justinkelly
Copy link
Author

justinkelly commented Oct 10, 2018

@SDRausty am usign an arm based chromebook (asus flip), have the latest termuxarch from git, but it always downloads arch instead of alpine

even if i select alpine in the menu, arch is still downloaded

@gauloics
Copy link

@SDRausty Do you still build other Linux flavor options?

@SDRausty
Copy link
Owner

SDRausty commented Dec 18, 2020

Do you still build other Linux flavor options?

citing Originally posted by @xeffyr in termux/termux-app#376 (comment)

Look my answers above. No one here will bother to implement a tool for userspace image mounting. Please understand that possibilities of Termux maintainers are finite.

Those who really needs mounting as non-root can use QEMU system-mode.

citing Originally posted by @xeffyr in termux/termux-packages#6141 (comment)

Start with these:

Boot downloaded image (basic):

qemu-system-i386 -m 512M -nographic -cdrom alpine-virt-3.12.2-x86.iso

Modified to boot from URL with no local image:

qemu-system-i386 -m 512M -nographic -boot d -drive file=https://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86/alpine-virt-3.12.2-x86.iso,readonly=on,media=cdrom

In both cases output is printed directly to console as image supports serial line emulated by QEMU.
CTRL+a x to terminate VM.

qemu

Extending command line by switching to VirtIO devices (rng, nic, drives), increasing TCG cache (e.g. by -accel tcg,tb-size=512), using musl-based & non-systemd distributions like Alpine Linux makes execution under QEMU faster.


Arch Linux can be booted too, yet it is slower and ISO will require many RAM (1-2 GB, maybe more). Probably will have issues with text-only mode and you will need a VNC.

Originally posted by @SDRausty in TermuxArch/TermuxArch#34 (comment)

@SDRausty
Copy link
Owner

SDRausty commented Dec 18, 2020

Thank you for sharing @justinkelly @gauloics;
Command taqemualpinex86.bash is ready for testing with this 8d30c0d commit:

Welcome to Alpine Linux 3.12
Kernel 5.4.83-0-virt on an i686 (/dev/ttyS0)

localhost login: root
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <http://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

localhost:~#

Please share your experience here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants