如何在嵌入式 Linux Raspberry Pi 上安装 GCC 和/或 apt

2024-02-05

我在树莓派(用于比特币矿工)上有一个预配置的 Linux 发行版。 问题是这个发行版非常小,只有 busybox 用于基本命令。它没有包管理器,甚至没有 gcc 编译器。所以我的目标是在上面安装一个 gcc 编译器,这样我就可以进一步安装其他软件。

所以我基本上仅限于 busybox 中的这些命令:

root@raspberrypi:~# ls /bin
addgroup             fgrep                ping6
adduser              grep                 ps
ash                  gunzip               pwd
busybox              gzip                 rm
cat                  hostname             rmdir
chattr               ip                   sed
chgrp                kill                 sh
chmod                ln                   sleep
chown                login                stty
cp                   ls                   su
cpio                 mkdir                sync
date                 mknod                tar
dd                   mktemp               tinylogin
delgroup             more                 touch
deluser              mount                true
df                   mountpoint           umount
dmesg                mountpoint.sysvinit  uname
dnsdomainname        mv                   usleep
dumpkmap             netstat              vi
echo                 pidof                zcat
egrep                pidof.sysvinit
false                ping
root@raspberrypi:~# ls -l /usr/bin
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 [ -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 [[ -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 ar -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 awk -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 basename -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 bunzip2 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 bzcat -> /bin/busybox
-rwxr-xr-x    1 root     root        302368 Apr 22  2014 cgminer
-rwxrwxr-x    1 root     root          4179 Apr 18  2014 cherryd
lrwxrwxrwx    1 root     root            17 Feb 21 14:30 chvt -> /usr/bin/chvt.kbd
-rwxr-xr-x    1 root     root          6860 Feb 19 12:23 chvt.kbd
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 clear -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 cmp -> /bin/busybox
-rwxr-xr-x    1 root     root          4304 Mar 11 03:18 cracklib-check
-rwxr-xr-x    1 root     root           218 Mar 11 03:18 cracklib-format
-rwxr-xr-x    1 root     root          4796 Mar 11 03:18 cracklib-packer
-rwxr-xr-x    1 root     root          3968 Mar 11 03:18 cracklib-unpacker
-rwxr-xr-x    1 root     root           990 Mar 11 03:18 create-cracklib-dict
-rwxr-xr-x    1 root     root        135908 Mar 28 12:33 curl
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 cut -> /bin/busybox
lrwxrwxrwx    1 root     root            23 Feb 21 14:37 dbclient -> /usr/sbin/dropbearmulti
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 dc -> /bin/busybox
-rwxr-xr-x    1 root     root         13372 Feb 19 12:24 ddcmon
lrwxrwxrwx    1 root     root            22 Feb 21 14:30 deallocvt -> /usr/bin/deallocvt.kbd
-rwxr-xr-x    1 root     root          7352 Feb 19 12:23 deallocvt.kbd
-rwxr-xr-x    1 root     root         64815 Feb 19 12:24 decode-dimms
-rwxr-xr-x    1 root     root          6104 Feb 19 12:24 decode-edid
-rwxr-xr-x    1 root     root          5650 Feb 19 12:24 decode-vaio
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 diff -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 dirname -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 du -> /bin/busybox
-rwxr-xr-x    1 root     root         58744 Feb 19 12:23 dumpkeys
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 dumpleases -> /bin/busybox
-rwxr-xr-x    1 root     root           287 Feb 19 12:24 easy_install
-rwxr-xr-x    1 root     root           295 Feb 19 12:24 easy_install-2.7
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 env -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 expr -> /bin/busybox
lrwxrwxrwx    1 root     root            22 Feb 21 14:30 fgconsole -> /usr/bin/fgconsole.kbd
-rwxr-xr-x    1 root     root          7460 Feb 19 12:23 fgconsole.kbd
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 find -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 flock -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 free -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 fuser -> /bin/busybox
-rwxr-xr-x    1 root     root          7736 Feb 19 12:23 getkeycodes
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 groups -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 head -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 hexdump -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 id -> /bin/busybox
-rwxr-xr-x    1 root     root          7936 Feb 19 12:23 kbd_mode
-rwxr-xr-x    1 root     root          8492 Feb 19 12:23 kbdrate
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 killall -> /bin/busybox
lrwxrwxrwx    1 root     root            22 Feb 21 14:32 last -> /usr/bin/last.sysvinit
-rwxr-xr-x    1 root     root         14048 Feb 19 12:15 last.sysvinit
lrwxrwxrwx    1 root     root             4 Feb 21 14:32 lastb -> last
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 less -> /bin/busybox
-rwxr-xr-x    1 root     root         85348 Feb 19 12:23 loadkeys
-rwxr-xr-x    1 root     root         19952 Feb 19 12:23 loadunimap
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 logger -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 logname -> /bin/busybox
-rwxr-xr-x    1 root     root          1229 Feb 19 12:24 mako-render
-rwxr-xr-x    1 root     root         15000 Feb 19 12:23 mapscrn
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 md5sum -> /bin/busybox
lrwxrwxrwx    1 root     root            22 Feb 21 14:32 mesg -> /usr/bin/mesg.sysvinit
-rwxr-xr-x    1 root     root          6532 Feb 19 12:15 mesg.sysvinit
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 microcom -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 mkfifo -> /bin/busybox
-rwxr-xr-x    1 root     root         18056 Mar 11 03:20 mkhomedir_helper
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 nc -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 nohup -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 nslookup -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 od -> /bin/busybox
-rwxr-xr-x    1 root     root        488032 Apr 18  2014 openssl
lrwxrwxrwx    1 root     root            19 Feb 21 14:30 openvt -> /usr/bin/openvt.kbd
-rwxr-xr-x    1 root     root         12084 Feb 19 12:23 openvt.kbd
-rwxr-xr-x    1 root     root          9852 Mar 11 03:20 pam_tally
-rwxr-xr-x    1 root     root          9872 Mar 11 03:20 pam_tally2
-rwxr-xr-x    1 root     root          9904 Mar 11 03:20 pam_timestamp_check
lrwxrwxrwx    1 root     root            14 Feb 21 14:30 passwd -> /bin/tinylogin
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 patch -> /bin/busybox
lrwxrwxrwx    1 root     root            10 Feb 21 14:37 perl -> perl5.14.3
-rwxr-xr-x    1 root     root          8768 Feb 19 12:25 perl5.14.3
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 printf -> /bin/busybox
lrwxrwxrwx    1 root     root             9 Feb 21 14:30 psfaddtable -> psfxtable
lrwxrwxrwx    1 root     root             9 Feb 21 14:30 psfgettable -> psfxtable
lrwxrwxrwx    1 root     root             9 Feb 21 14:30 psfstriptable -> psfxtable
-rwxr-xr-x    1 root     root         16844 Feb 19 12:23 psfxtable
lrwxrwxrwx    1 root     root            28 Feb 21 14:32 psplash -> /usr/bin/psplash-raspberrypi
-rwxr-xr-x    1 root     root         50484 Feb 19 12:16 psplash-default
-rwxr-xr-x    1 root     root        113760 Feb 19 12:16 psplash-raspberrypi
-rwxr-xr-x    1 root     root          5516 Feb 19 12:16 psplash-write
lrwxrwxrwx    1 root     root             7 Feb 21 14:37 python -> python2
lrwxrwxrwx    1 root     root            14 Feb 21 14:37 python-config -> python2-config
lrwxrwxrwx    1 root     root             9 Feb 21 14:37 python2 -> python2.7
lrwxrwxrwx    1 root     root            16 Feb 21 14:37 python2-config -> python2.7-config
-rwxr-xr-x    1 root     root          6268 Apr 18  2014 python2.7
-rwxr-xr-x    1 root     root          1618 Feb 19 12:19 python2.7-config
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 readlink -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 realpath -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 renice -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 reset -> /bin/busybox
-rwxr-xr-x    1 root     root         11882 Feb 19 12:24 rpio
-rwxr-xr-x    1 root     root         16597 Feb 19 12:24 rpio-curses
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 run-parts -> /bin/busybox
lrwxrwxrwx    1 root     root            23 Feb 21 14:37 scp -> /usr/sbin/dropbearmulti
lrwxrwxrwx    1 root     root            12 Mar 11 02:22 screen -> screen-4.0.3
-rwxr-xr-x    1 root     root        312200 Mar 11 02:22 screen-4.0.3
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 seq -> /bin/busybox
-rwxr-xr-x    1 root     root         33868 Feb 19 12:23 setfont
-rwxr-xr-x    1 root     root          7276 Feb 19 12:23 setkeycodes
-rwxr-xr-x    1 root     root          8768 Feb 19 12:23 setleds
-rwxr-xr-x    1 root     root          6900 Feb 19 12:23 setmetamode
-rwxr-xr-x    1 root     root         14260 Feb 19 12:23 showconsolefont
-rwxr-xr-x    1 root     root         10020 Feb 19 12:23 showkey
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 sort -> /bin/busybox
-rwxr-xr-x    1 root     root         49100 Feb 19 12:13 sqlite3
lrwxrwxrwx    1 root     root            23 Feb 21 14:37 ssh -> /usr/sbin/dropbearmulti
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 stat -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 strings -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 tail -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 tee -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 telnet -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 test -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 tftp -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 time -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 top -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 tr -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 traceroute -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 tty -> /bin/busybox
-rwxr-xr-x    1 root     root        137588 Feb 19 12:23 udevadm
-rwxr-xr-x    1 root     root          2425 Feb 19 12:23 unicode_start
-rwxr-xr-x    1 root     root           363 Feb 19 12:23 unicode_stop
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 uniq -> /bin/busybox
-rwxr-xr-x    1 root     root         26424 Mar 11 03:20 unix_chkpwd
-rwxr-xr-x    1 root     root         26412 Mar 11 03:20 unix_update
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 unzip -> /bin/busybox
-rwxr-xr-x    1 root     root          4267 Feb 19 12:09 update-alternatives
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 uptime -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 users -> /bin/busybox
lrwxrwxrwx    1 root     root            26 Feb 21 14:32 utmpdump -> /usr/bin/utmpdump.sysvinit
-rwxr-xr-x    1 root     root          9568 Feb 19 12:15 utmpdump.sysvinit
lrwxrwxrwx    1 root     root            14 Feb 21 14:30 vlock -> /bin/tinylogin
lrwxrwxrwx    1 root     root            22 Feb 21 14:32 wall -> /usr/bin/wall.sysvinit
-rwxr-xr-x    1 root     root         10764 Feb 19 12:15 wall.sysvinit
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 watch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 wc -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 wget -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 which -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 who -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 whoami -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 xargs -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 yes -> /bin/busybox

到目前为止我所尝试的是从下载一个新的busyboxhere http://busybox.net/downloads/binaries/latest/busybox-armv7l其中包括更多命令,最显着的是 rpm(尽管仍然缺少 dpkg)

root@raspberrypi:~# ./busybox-armv7l
BusyBox v1.21.1 (2013-07-08 10:26:30 CDT) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash, awk, base64,
        basename, beep, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat,
        catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum,
        clear, cmp, comm, conspy, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd,
        deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd,
        dnsdomainname, dos2unix, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir,
        envuidgid, ether-wake, expand, expr, fakeidentd, false, fbset, fbsplash, fdflush,
        fdformat, fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk, fsck,
        fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, groups, gunzip,
        gzip, halt, hd, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id,
        ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, insmod, install, ionice, iostat,
        ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kbd_mode, kill,
        killall, killall5, klogd, last, less, linux32, linux64, linuxrc, ln, loadfont, loadkmap,
        logger, login, logname, logread, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lsof, lspci,
        lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom,
        mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd,
        mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif,
        nanddump, nandwrite, nbd-client, nc, netstat, nice, nmeter, nohup, nslookup, ntpd, od,
        openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap,
        popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pstree, pwd, pwdx,
        raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath, reboot, reformime,
        remove-shell, renice, reset, resize, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio,
        rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail,
        seq, setarch, setconsole, setfont, setkeycodes, setlogcons, setserial, setsid, setuidgid,
        sh, sha1sum, sha256sum, sha3sum, sha512sum, showkey, slattach, sleep, smemcap, softlimit,
        sort, split, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svlogd,
        swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet,
        telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true,
        tty, ttysize, tunctl, udhcpc, udhcpd, udpsvd, umount, uname, unexpand, uniq, unix2dos,
        unlzma, unlzop, unxz, unzip, uptime, users, usleep, uudecode, uuencode, vconfig, vi,
        vlock, volname, wall, watch, watchdog, wc, wget, which, who, whoami, whois, xargs, xz,
        xzcat, yes, zcat, zcip

我从这里下载了一些 gcc rpm但由于某种原因 gcc 不执行

root@raspberrypi:~# ./busybox-armv7l rpm -i gcc-4.8.2-1.fc20.armv7hl.rpm
root@raspberrypi:~# find / -name gcc
/usr/bin/gcc
/usr/share/doc/gcc
/usr/lib/gcc
/usr/libexec/gcc
/opt/STM/STLinux-2.4/devkit/armv7/target/usr/bin/gcc
/opt/STM/STLinux-2.4/devkit/armv7/target/usr/lib/gcc
/opt/STM/STLinux-2.4/devkit/armv7/target/usr/libexec/gcc
root@raspberrypi:~# cd /usr/bin
root@raspberrypi:/usr/bin# ./gcc
-sh: ./gcc: not found
root@raspberrypi:/usr/bin# ls -l
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 [ -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 [[ -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 ar -> /bin/busybox
-rwxr-xr-x    1 root     root        562184 Mar 29 02:30 arm-linux-gnu-cpp
-rwxr-xr-x    1 root     root        562184 Mar 29 02:30 arm-linux-gnu-gcc
-rwxr-xr-x    1 root     root        257596 Mar 29 02:30 arm-linux-gnu-gcov
-rwxr-xr-x    2 root     root        622224 Oct 17 10:53 armv7hl-redhat-linux-gnueabi-gcc
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 awk -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 basename -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 bunzip2 -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 bzcat -> /bin/busybox
-rwxr-xr-x    1 root     root           224 Oct 17 10:52 c89
-rwxr-xr-x    1 root     root           215 Oct 17 10:52 c99
lrwxrwxrwx    1 root     root             3 Apr 10 21:31 cc -> gcc
-rwxr-xr-x    1 root     root        302368 Apr 22  2014 cgminer
-rwxrwxr-x    1 root     root          4179 Apr 18  2014 cherryd
lrwxrwxrwx    1 root     root            17 Feb 21 14:30 chvt -> /usr/bin/chvt.kbd
-rwxr-xr-x    1 root     root          6860 Feb 19 12:23 chvt.kbd
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 clear -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 cmp -> /bin/busybox
-rwxr-xr-x    1 root     root          4304 Mar 11 03:18 cracklib-check
-rwxr-xr-x    1 root     root           218 Mar 11 03:18 cracklib-format
-rwxr-xr-x    1 root     root          4796 Mar 11 03:18 cracklib-packer
-rwxr-xr-x    1 root     root          3968 Mar 11 03:18 cracklib-unpacker
-rwxr-xr-x    1 root     root           990 Mar 11 03:18 create-cracklib-dict
....
-rwxr-xr-x    1 root     root           287 Feb 19 12:24 easy_install
-rwxr-xr-x    1 root     root           295 Feb 19 12:24 easy_install-2.7
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 env -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 expr -> /bin/busybox
lrwxrwxrwx    1 root     root            22 Feb 21 14:30 fgconsole -> /usr/bin/fgconsole.kbd
-rwxr-xr-x    1 root     root          7460 Feb 19 12:23 fgconsole.kbd
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 find -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 flock -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 free -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 fuser -> /bin/busybox
-rwxr-xr-x    2 root     root        622224 Oct 17 10:53 gcc
-rwxr-xr-x    1 root     root         25900 Oct 17 10:54 gcc-ar
-rwxr-xr-x    1 root     root         25856 Oct 17 10:53 gcc-nm
-rwxr-xr-x    1 root     root         25864 Oct 17 10:54 gcc-ranlib
-rwxr-xr-x    1 root     root        260996 Oct 17 10:54 gcov
-rwxr-xr-x    1 root     root          7736 Feb 19 12:23 getkeycodes
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 groups -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 head -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 hexdump -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 id -> /bin/busybox
-rwxr-xr-x    1 root     root          7936 Feb 19 12:23 kbd_mode
-rwxr-xr-x    1 root     root          8492 Feb 19 12:23 kbdrate
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 killall -> /bin/busybox
lrwxrwxrwx    1 root     root            22 Feb 21 14:32 last -> /usr/bin/last.sysvinit
-rwxr-xr-x    1 root     root         14048 Feb 19 12:15 last.sysvinit
lrwxrwxrwx    1 root     root             4 Feb 21 14:32 lastb -> last
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 less -> /bin/busybox
-rwxr-xr-x    1 root     root         85348 Feb 19 12:23 loadkeys
-rwxr-xr-x    1 root     root         19952 Feb 19 12:23 loadunimap
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 logger -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 logname -> /bin/busybox
-rwxr-xr-x    1 root     root          1229 Feb 19 12:24 mako-render
-rwxr-xr-x    1 root     root         15000 Feb 19 12:23 mapscrn
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 md5sum -> /bin/busybox
lrwxrwxrwx    1 root     root            22 Feb 21 14:32 mesg -> /usr/bin/mesg.sysvinit
-rwxr-xr-x    1 root     root          6532 Feb 19 12:15 mesg.sysvinit
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 microcom -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 mkfifo -> /bin/busybox
-rwxr-xr-x    1 root     root         18056 Mar 11 03:20 mkhomedir_helper
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 nc -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 nohup -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 nslookup -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 od -> /bin/busybox
-rwxr-xr-x    1 root     root        488032 Apr 18  2014 openssl
lrwxrwxrwx    1 root     root            19 Feb 21 14:30 openvt -> /usr/bin/openvt.kbd
-rwxr-xr-x    1 root     root         12084 Feb 19 12:23 openvt.kbd
-rwxr-xr-x    1 root     root          9852 Mar 11 03:20 pam_tally
-rwxr-xr-x    1 root     root          9872 Mar 11 03:20 pam_tally2
-rwxr-xr-x    1 root     root          9904 Mar 11 03:20 pam_timestamp_check
lrwxrwxrwx    1 root     root            14 Feb 21 14:30 passwd -> /bin/tinylogin
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 patch -> /bin/busybox
lrwxrwxrwx    1 root     root            10 Feb 21 14:37 perl -> perl5.14.3
-rwxr-xr-x    1 root     root          8768 Feb 19 12:25 perl5.14.3
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 printf -> /bin/busybox
lrwxrwxrwx    1 root     root             9 Feb 21 14:30 psfaddtable -> psfxtable
lrwxrwxrwx    1 root     root             9 Feb 21 14:30 psfgettable -> psfxtable
lrwxrwxrwx    1 root     root             9 Feb 21 14:30 psfstriptable -> psfxtable
-rwxr-xr-x    1 root     root         16844 Feb 19 12:23 psfxtable
lrwxrwxrwx    1 root     root            28 Feb 21 14:32 psplash -> /usr/bin/psplash-raspberrypi
-rwxr-xr-x    1 root     root         50484 Feb 19 12:16 psplash-default
-rwxr-xr-x    1 root     root        113760 Feb 19 12:16 psplash-raspberrypi
-rwxr-xr-x    1 root     root          5516 Feb 19 12:16 psplash-write
lrwxrwxrwx    1 root     root             7 Feb 21 14:37 python -> python2
lrwxrwxrwx    1 root     root            14 Feb 21 14:37 python-config -> python2-config
lrwxrwxrwx    1 root     root             9 Feb 21 14:37 python2 -> python2.7
lrwxrwxrwx    1 root     root            16 Feb 21 14:37 python2-config -> python2.7-config
-rwxr-xr-x    1 root     root          6268 Apr 18  2014 python2.7
-rwxr-xr-x    1 root     root          1618 Feb 19 12:19 python2.7-config
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 readlink -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 realpath -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 renice -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 reset -> /bin/busybox
-rwxr-xr-x    1 root     root         11882 Feb 19 12:24 rpio
-rwxr-xr-x    1 root     root         16597 Feb 19 12:24 rpio-curses
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 run-parts -> /bin/busybox
lrwxrwxrwx    1 root     root            23 Feb 21 14:37 scp -> /usr/sbin/dropbearmulti
lrwxrwxrwx    1 root     root            12 Mar 11 02:22 screen -> screen-4.0.3
-rwxr-xr-x    1 root     root        312200 Mar 11 02:22 screen-4.0.3
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 seq -> /bin/busybox
-rwxr-xr-x    1 root     root         33868 Feb 19 12:23 setfont
-rwxr-xr-x    1 root     root          7276 Feb 19 12:23 setkeycodes
-rwxr-xr-x    1 root     root          8768 Feb 19 12:23 setleds
-rwxr-xr-x    1 root     root          6900 Feb 19 12:23 setmetamode
-rwxr-xr-x    1 root     root         14260 Feb 19 12:23 showconsolefont
-rwxr-xr-x    1 root     root         10020 Feb 19 12:23 showkey
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 sort -> /bin/busybox
-rwxr-xr-x    1 root     root         49100 Feb 19 12:13 sqlite3
.....
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 tty -> /bin/busybox
-rwxr-xr-x    1 root     root        137588 Feb 19 12:23 udevadm
-rwxr-xr-x    1 root     root          2425 Feb 19 12:23 unicode_start
-rwxr-xr-x    1 root     root           363 Feb 19 12:23 unicode_stop
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 uniq -> /bin/busybox
-rwxr-xr-x    1 root     root         26424 Mar 11 03:20 unix_chkpwd
-rwxr-xr-x    1 root     root         26412 Mar 11 03:20 unix_update
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 unzip -> /bin/busybox
-rwxr-xr-x    1 root     root          4267 Feb 19 12:09 update-alternatives
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 uptime -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 users -> /bin/busybox
lrwxrwxrwx    1 root     root            26 Feb 21 14:32 utmpdump -> /usr/bin/utmpdump.sysvinit
-rwxr-xr-x    1 root     root          9568 Feb 19 12:15 utmpdump.sysvinit
lrwxrwxrwx    1 root     root            14 Feb 21 14:30 vlock -> /bin/tinylogin
lrwxrwxrwx    1 root     root            22 Feb 21 14:32 wall -> /usr/bin/wall.sysvinit
-rwxr-xr-x    1 root     root         10764 Feb 19 12:15 wall.sysvinit
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 watch -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 wc -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 wget -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 which -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 who -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 whoami -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 xargs -> /bin/busybox
lrwxrwxrwx    1 root     root            12 Feb 21 14:30 yes -> /bin/busybox

还尝试安装 apt-rpm 来获取 apt-get,但它缺少共享库

root@raspberrypi:~# apt-get
apt-get: error while loading shared libraries: /usr/lib/liblua-5.1.so: internal error

有人可以帮我解决这一切吗?


您已将此帖子标记为“yocto”。 所以我唯一可以建议你的是使用这个很棒的工具:) 你不想从你的 raspi 编译你的工具,而是从你的杀手级 Linux 机器上编译:)

首先,确保您具备所有先决条件。 对于软呢帽:

sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \
     diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \
     ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat

对于 ubuntu/debian:

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
 build-essential chrpath socat

然后,你可以从 git://git.yoctoproject.org/poky 获取 yocto

git clone git://git.yoctoproject.org/poky -b daisy

然后,您需要获取raspberrypi层及其依赖项:

cd poky
git clone http://git.yoctoproject.org/git/meta-raspberrypi -b daisy
git clone git://git.openembedded.org/meta-openembedded -b daisy

然后,设置构建环境:

source oe-init-build-env rpi-build

这里 rpi-build 将是构建目录的名称,它可以是你想要的任何名称。 这将设置使用 yocto 所需的所有环境变量,并将您移动到新创建的构建目录。

编辑conf/bblayers.conf 并将所需的图层添加到 BBLAYERS。它应该看起来像这样:

BBLAYERS ?= " \                                                                 
  /path/to/poky/meta \                      
  /path/to/poky/meta-yocto \                
  /path/to/poky/meta-yocto-bsp \            
  /path/to/poky/meta-openembedded/meta-oe \ 
  /path/to/poky/meta-raspberrypi \                            
"

然后,编辑conf/local.conf 将 MACHINE 变量设置为 raspberrypi:

MACHINE ?= "raspberrypi"

您还可以通过更改来告诉 yocto 生成 deb 文件而不是默认的 rpm:

PACKAGE_CLASSES ?= "package_rpm"

to:

PACKAGE_CLASSES ?= "package_deb"

为了快速让 dpkg 出现在构建中,只需在 conf/local.conf 中添加以下行

CORE_IMAGE_EXTRA_INSTALL="dpkg"

并创建一个基本图像:

bitbake rpi-basic-image

这将需要一些时间......实际上需要很多时间(yocto 将生成整个根文件系统,它将下载源代码并编译它们,将为每个源创建 deb 包,并将生成可闪存的 s 映像)。

在此期间,我建议您阅读 yocto 文档,以了解如何向生成的图像添加更多软件和/或自定义它。 解释 yocto 的工作原理不仅仅只是 stackoverflow 中的答案,您还需要阅读文档并进行一些练习。

但要了解的主要一点是 yocto 提供了收据。基本上,收据描述了如何获取包以及如何编译它。 收据的简单示例可以在以下位置找到:

meta/recipes-devtools/rpm/rpmresolve_1.0.bb

yocto 的好处是您可以轻松添加自己的收据。 层提供了recipes的超集,它们还允许定制。 在这里,我们添加了 raspberrypi 层以添加对树莓派的支持。 树莓派层提供了配置内核、引导加载程序等所需的所有信息...

编译完成后,为了刷新生成的 SD 映像,只需执行以下操作:

dd bs=4M if=/path/to/rpi-build/tmp/deploy/images/raspberrypi/rpi-basic-image-raspberrypi.rpi-sdimg of=/dev/sd?

“SD”在哪里?是你的(未安装的)SD卡(如果需要的话考虑保存它) 将你的 SD 卡插回你的 raspi, 启动它。

为了找出 raspi IP,您可以扫描网络以查找开放的 ssh 端口:

nmap -p 22 --open -sV YOU_SUBNET_ADDRESS/SUBNET_SIZE

example:

nmap -p 22 --open -sV 192.168.1.0/24


ssh root@RASPI-IP

瞧!

下次你需要构建一个新包时,你可以这样做:

bitbake package-name

然后将生成的 .deb 文件(从 tmp/work/armv6-vfp-poky-linux-gnueabi/PACKAGE_NAME/PACKAGE_VERSION/deploy-debs/armv6-vfp/PACKAGE.ipk)复制到 raspi 并使用 dpkg 来安装它。 您还可以基于 rpi-basic-image 创建自己的映像并添加您自己选择的软件包。

htop 示例:

bitbake htop
scp ./tmp/work/armv6-vfp-poky-linux-gnueabi/htop/1.0.3-r0/deploy-debs/armv6-vfp/htop_1.0.3-r0_armv6-vfp.deb root@myraspi

yocto 对于简化交叉编译过程非常有帮助。

来源:https://github.com/djwillis/meta-raspberrypi https://github.com/djwillis/meta-raspberrypi https://yoctoproject.org https://yoctoproject.org

kamou

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在嵌入式 Linux Raspberry Pi 上安装 GCC 和/或 apt 的相关文章

  • 类和结构在填充和继承方面的区别

    以下所有操作都将在 GCC 9 1 上使用编译器资源管理器 https github com mattgodbolt compiler explorer 在 x86 64 中 使用 O3 我有这个代码 struct Base Base do
  • 使用基类指针创建对象时缺少派生类析构函数

    在下面的代码示例中 未调用派生类析构函数 知道为什么吗 我有一个具有虚函数的基类 现在我使用基类指针来创建派生类的新对象 我的理解是 当派生类对象被销毁时 首先调用派生类的析构函数 然后调用基类 但是我只看到基类的析构函数被调用 有谁知道我
  • Clang 使用 -nostdlib 生成崩溃代码

    我正在尝试为可执行文件设置自己的运行时环境 但无法使用 clang v3 4 1ubuntu1 目标 x86 64 pc linux gnu 来生成没有段错误的可执行文件 我已将问题简化为以下内容 如果我有一个文件 crt1 c 除了满足
  • gcc 的 -Wbad-function-cast 的目的是什么?

    根据此处答案的建议 我打开了 Wbad function cast看看我的代码是否有 gcc 可以捕获的任何不良行为 结果出现了这个示例 unsigned long n int crossover int pow n 14 这里并不重要cr
  • 使用 -static-libgcc -static-libstdc++ 编译仍然会导致对 libc.so 的动态依赖

    我正在尝试制作一个尽可能可移植的可执行文件 删除一些依赖项后 我在另一个系统上运行二进制文件时遇到以下问题 lib x86 64 linux gnu libm so 6 version GLIBC 2 15 not found requir
  • 使用 AVX 内在函数代替 SSE 并不能提高速度 - 为什么?

    我已经使用 Intel 的 SSE 内在函数相当长一段时间了 并取得了良好的性能提升 因此 我希望 AVX 内在函数能够进一步加速我的程序 不幸的是 直到现在情况并非如此 可能我犯了一个愚蠢的错误 所以如果有人能帮助我 我将非常感激 我使用
  • 软件预取手动指令合理的场景

    我读过有关 x86 和 x86 64 Intel 的内容gcc提供特殊的预取指令 include
  • typeof() 表达式内的副作用

    在 GNUC C 中 您可以使用typeof expression 并且使用内部带有副作用的表达式是合法的 例如 您可以使用以下 C 代码 int x 0 typeof x y 在这种情况下 副作用被忽略 并且 x 之后仍然为零 这是有道理
  • 在 Ubuntu 上用 C 项目编译和链接 GTK 3

    我相信这不是重复的问题 在发布此问题之前我已经看过所有问题 答案 我想我这里的情况有所不同 我使用Ubuntu 12 04并下载GTK 2 和 3 我从 GNOME 网站复制了一个简单的 GTK 源代码 但是当我在终端中使用这个命令时 gc
  • 这种对有效类型规则的使用是否严格遵守?

    C99和C11中的有效类型规则规定 没有声明类型的存储可以用任何类型写入 并且存储非字符类型的值将相应地设置存储的有效类型 抛开 INT MAX 可能小于 123456789 的事实不谈 以下代码对有效类型规则的使用是否严格符合 inclu
  • 公共基类打破了元组的空基类优化

    gcc 4 7 1 对元组进行空基类优化 我认为这是一个非常有用的功能 然而 这似乎有一个意想不到的限制 include
  • Gcc 4.2 版本缺失

    在我的带有 osx lion 和 XCode 4 1 的新 macbook pro 上 我遇到了一些 gcc 问题 In usr bin我找不到gcc 4 2 我只有以下版本 i686 apple darwin11 llvm gcc 4 2
  • 为什么这个未使用的变量没有被优化掉?

    我使用了 Godbolt 的 CompilerExplorer 我想看看某些优化有多好 我的最小工作示例是 include
  • Yocto“无法运行 qemu:无法初始化 SDL(x11 不 > 可用)”

    所以我在本地构建服务器上安装了 Yocto 因为谁希望大规模构建占用他们的工作区 amirite 主机和服务器是Arch Linux 4 19 44 1 lts 无论如何 我只是从找到的快速构建页面运行示例here https www yo
  • 带有适用于 MS-Windows 的工具链的预构建 MIPS 交叉编译器

    我在我的 Linux 机器上使用 MIPS 交叉编译器 效果很好 现在我需要在 Windows 上编译相同的应用程序 我正在网上搜索一些适用于 MS Windows 的预构建 MIPS 交叉编译器 带有工具链 但没有成功 由于我不确定该怎么
  • gcc 中 -g 选项的作用是什么

    我看到很多关于 gdb 的教程要求在编译 c 程序时使用 g 选项 我无法理解 g 选项的实际作用 它使编译器将调试信息添加到生成的二进制文件中 此信息允许调试器将代码中的指令与源代码文件和行号相关联 拥有调试符号可以使某些类型的调试 例如
  • 为什么 GCC 交叉编译不构建“crti.o”?

    在尝试为arm构建gcc 4 x x交叉编译器时 我陷入了缺失的困境crti o文件在 BUILD DIR gcc子目录 An strace在顶层Makefile表明编译后的xgcc正在调用交联器ld with crti o 作为一个论点
  • 嵌入式Linux poll()不断返回

    我有一个特别的问题 当我知道没有什么可读时 民意调查不断返回 因此设置如下 我有 2 个文件描述符 它们构成fd设置民意调查监视 一种用于引脚从高到低的变化 GPIO 另一个用于代理输入 代理输入出现问题 处理的顺序是 启动main函数 然
  • 如何修复“iptables:没有该名称的链/目标/匹配”?

    我在我的 Linux 嵌入式系统上构建并安装了 iptables 如果我列出所有规则 则一切正常 iptables list Chain INPUT policy ACCEPT target prot opt source destinat
  • C99 中数组的静态大小[重复]

    这个问题在这里已经有答案了 一个非常简单的 C 程序 include

随机推荐

  • Eclipse 继续崩溃

    今天我的 Eclipse 继续崩溃并向我显示以下消息 A fatal error has been detected by the Java Runtime Environment SIGSEGV 0xb at pc 0x00007f9d6
  • 链接静态库,共享另一个静态库

    我目前有一个用于非常大的代码库的 Xcode 项目 我将其称为X计划 我将其分为一堆子项目 项目A B C 到目前为止 每个项目都可以自行编译 效果很好 它们都生成静态库 项目B and 项目C依赖于生成的静态库项目A为了建造 我有另一个
  • 在 Golang 中导入包的本地更改而不推送代码

    我现在正在学习 Golang 而且还是个新手 我有一个关于包裹的问题 考虑以下场景 假设我有一个包裹github com ilatif A我正在其中导入另一个包github com ilatif B like import github c
  • 收到推送通知时添加新通知(不替换之前的通知)

    我在我的应用程序中使用推送通知 我需要在发送推送通知时显示通知 如果我发送另一个通知 没有清除之前的通知 它将替换旧的通知 这是我使用的代码 NotificationManager mNotificationManager Notifica
  • 谷歌应用程序脚本中的 CopyTo 将无法完成超过 1000 行的执行

    I am using originalRange copyTo rangeToCopyTo to basically pull down functions for the number of rows of data I have Cop
  • PHP - 我们应该在会话中包含哪些数据?

    这是一个初学者的问题 在网站中 会话中应该或不应该包含什么类型的数据 我了解我不应包含任何需要保证安全的信息 我对编程最佳实践更感兴趣 例如 可以在会话中包含一些数据 否则这些数据将作为依赖项注入从一个页面发送到另一个页面 这不是相当于创建
  • 如何在 Python 中将 CIDR 前缀转换为点分四组网络掩码?

    如何在 Python 中将 CIDR 前缀转换为点分四组网络掩码 例如 如果前缀是12我需要返回255 240 0 0 这是一个较轻松的解决方案 没有模块依赖项 netmask join str 0xffffffff lt lt 32 le
  • 如何将指针设置到第零位置?

    据我所知 在预处理阶段 代码中所有出现的 NULL 都会被 0 替换 然后在编译期间 指针上下文中出现的所有 0 都将替换为在该机器上表示 NULL 的适当值 因此 编译器必须知道该特定机器的 NULL 值 现在 这意味着每当我在指针上下文
  • R 中的合并命令

    我一直在使用 R 中的合并命令 并试图找出如何使用 SUFFIX 参数 在线文档并没有很好地解释它 我想做的是导入一些 csv 文件 data1 lt read csv fileA header T data2 lt read csv fi
  • 我想一次滚动多个回收器视图如何实现

    我想滚动多个RecyclerView一次如何实现该 Exp 我有 3RecyclerView水平方向 当我第一次滚动时RecyclerView那么第二个和第三个也应该滚动怎么办 答案很简单 你必须从一个回收视图获取滚动反馈并将其传递给其他回
  • python中的return和break有什么区别?

    python中的return和break有什么区别 请解释一下它们在循环和函数中到底做了什么 谢谢 break用于提前结束循环 whilereturn是用于将返回值传递回函数调用者的关键字 如果不带参数使用它 它只会结束函数并返回到之前执行
  • Angular 6:从后端服务器获取文件对象后下载文件

    我有一个结构为 type Buffer data Array 702549 的文件对象类型 我需要在 Angular 6 中做什么才能在浏览器中下载此文件 我从这个函数得到我的回应 getMarketingProposalById id s
  • 查找数组中出现次数最多的第 N 个数字

    Find the nth most frequent number in array There is no limit on the range of the numbers 我想我们可以 i 使用 C 中的映射存储每个元素的出现情况 i
  • 从 Facelets 调用 servlet 的正确方法?

    使用带有提交按钮的表单从 Facelets 文件调用 servlet 的正确方法是什么 是否需要特定表格 只需使用纯 HTML
  • 我想使用 jquery 操作 iframe 内的 html

    我想我可以通过将 jQuery 函数的上下文设置为 iframe 的文档来做到这一点 如下所示 function document ready some selector frames nameOfMyIframe document doS
  • 如何将字符串转换为长整型而不丢失前导零[重复]

    这个问题在这里已经有答案了 在我的网络服务方法中 我有一个输入类型Long 我应该在左边添加两个零 所以我将其转换为String 我连接了两个零 然后我应该再次转换为Long 我发现java中的Long类型忽略左零 如何在 Long 值中保
  • Android MLKit - 执行 Firebase ML 任务时发生内部错误

    您好 我有一个在 Android 应用程序中使用的自定义模型 但是当我尝试运行它时 会引发 MLkit 异常 所述错误的日志输出如下 Internal error has occurred when executing Firebase M
  • 什么是 SAPI?什么时候会使用它?

    我最近一直在学习 PHP 中的错误处理 并遇到了error log 功能 http docs php net manual en function error log php 在 PHP 手册中 它讨论了所有错误日志类型 我理解所有这些类型
  • 如何异步使用DataAdapter.Fill()?

    我有一个 DataAdapter 正在填充数据集中的 5 个数据表 SqlDataAdapter da new SqlDataAdapter Select from testTable con da Fill ds 0 numberOfRo
  • 如何在嵌入式 Linux Raspberry Pi 上安装 GCC 和/或 apt

    我在树莓派 用于比特币矿工 上有一个预配置的 Linux 发行版 问题是这个发行版非常小 只有 busybox 用于基本命令 它没有包管理器 甚至没有 gcc 编译器 所以我的目标是在上面安装一个 gcc 编译器 这样我就可以进一步安装其他