- fedora -> debian bootstrap (v1)
- setup apt
dnf group install development-toolsdnf install dpkg apt dpkg-dev autoconf automakesudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131 78DBA3BC47EF2265(TODO change this to/etc/apt/trusted.gpg.d/)sudo dnf install debian-keyringalternative
- binfmt emulation
sudo dnf install qemu-static-user
- make
apt-sourcesdir for sources to live in - equivs
apt source equivssudo rsync -rv usr/ /usr/
- break bootstrap chain for debhelper (needs something better)
apt download debhelpersudo dpkg -i --force-all debhelper....deb- and now its a bit broken
ln -s true {dh_strip_nondeterminism,dh_installchangelogs}sudo dnf reinstall debhelper- create
debhelper-compat.equivs# Source: <source package name; defaults to package name> Section: misc Priority: optional # Homepage: <enter URL here; no default> Standards-Version: 3.9.2 Package: debhelper-compat-meta Version: 1 Provides: debhelper-compat (= 12), debhelper-compat (= 13) Description: <short description; defaults to some wise words> long description and info . second paragraph equivs-build debhelper-compat.equivsapt remove debhelperdpkg -i debhelper-compat_13_all.deb(our version, not the old one)sudo dnf reinstall debhelper
- get essential packages list
psql "postgresql://udd-mirror:[email protected]/udd"\copy (select distinct package, version from packages where essential = 'yes' and release = 'sid') to 'essential.txt' with csv;
fake-installscript- in
/usr/local/bin/fake-install#!/bin/bash PACKAGE="$1" VERSION="$2" MULTIARCH="$3" ARCH="${4}" echo $MULTIARCH if [ -z "${ARCH}" ]; then if [ "${MULTIARCH}" = "foreign" ] || [ "${MULTIARCH}" = "allowed" ] ; then ARCH=all else ARCH=amd64 fi fi work=$(mktemp -d) cp /usr/local/share/fake-install/base.equivs ${work}/control pushd ${work}/ sed -i -e "s/@PACKAGE@/${PACKAGE}/" -e "s/@VERSION@/${VERSION}/" -e "s/@MULTIARCH@/${MULTIARCH}/" -e "s/@ARCH@/${ARCH}/" control equivs-build control >/dev/null sudo dpkg -i *.deb if mapping=$(grep -q "^${PACKAGE}," /usr/local/share/fake-install/mapping.txt); then mapped=$(echo "${mapping}" | cut -d',' -f2) sudo dnf install -qy ${install} else done=1 while [ "${done}" -ne 0 ]; do echo "Package name of the equivalent of ${PACKAGE} (${VERSION}) (- to drop to shell, enter to skip)" read -r install if [ "${install}" = "-" ]; then bash elif ! [ -z "${install}" ]; then sudo dnf install -qy ${install} test $? -eq 0 done=$? else done=0 fi done echo "${PACKAGE},${install}" >> /usr/local/share/fake-install/mapping.txt fi rm -r "${work}" - in
/usr/local/share/fake-install/base.equivsSection: misc Priority: optional Standards-Version: 3.9.2 Package: @PACKAGE@ Version: @VERSION@ Architecture: @ARCH@ Multi-Arch: @MULTIARCH@ Description: <short description; defaults to some wise words> long description and info . second paragraph
- in
- set up essential
while IFS=, read -r package version; do ./fake-install ${package} ${version}; done < essential.txt - get all the usual packages setup
\copy (select distinct on (package) package, version, multi_arch from packages where release = 'sid' order by package, version desc) to 'packages.txt' with csv;in psql again- copy
packages.txtto/usr/local/share/fake-install/
- temporarily enable binary packages,
apt update, cd to/var/lib/apt/lists, create/var/lib/dose/listscp deb.debian.org_debian_dists_unstable_main_binary-amd64_Packages ../../dose/lists/
remove binary packages,apt update - apt wrapper script
#!/bin/sh if [ "$1" = "install" ]; then shift while [ "$#" -gt 0 ]; do package="$1" if ! dpkg -l | grep -q " ${package} " >/dev/null; then #if true; then line="$(grep "^${package}," /usr/local/share/fake-install/packages.txt)" echo $line if [ -z "${line}" ]; then echo "${package} not found" exit 1 fi version="$(echo "${line}" | cut -d',' -f2)" multiarch="$(echo "${line}" | cut -d',' -f3)" arch="$(echo ${package} | grep -o ':any' | sed 's/://')" fake-install "${package}" "${version}" "${multiarch}" fi shift done elif [ "$1" = "build-dep" ] ; then shift apt install $(apt-get -s build-dep "$@" 2>&1 | grep Depends | sed -e 's/.*Depends: //' -e 's/:any//' | cut -d' ' -f1 | tr '\n' ' ') else apt-real "$@" fi- move
apttoapt-real
- move
- key build-essential deptree (TODO autogenerate)
apt install build-essential libc6-dev libc6 libc-dev-bin linux-libc-dev libcrypt-dev rpcsvc-proto cpp cpp-15 cpp-x86-64-linux-gnu gcc-15 gcc-x86-64-linux-gnu gcc-15-base binutils g++ g++-15 g++-x86-64-linux-gnu make dpkg-dev perl libdpkg-perl tar bzip2 xz-utils patch libbz2-1.0 liblzma5 ln -s gcc /usr/bin/x86_64-linux-gnu-gccln -s g++ /usr/bin/x86_64-linux-gnu-g++ln -s objcopy /usr/bin/x86_64-linux-gnu-objcopyln -s readelf /usr/bin/x86_64-linux-gnu-readelfln -s ../lib64 /usr/lib/x86_64-linux-gnu- from
apt source base-filesget/etc/os-releaseand fix to besid - https://github.com/konradhalas/dacite/archive/refs/tags/v1.9.2-fix.tar.gz install manually
apt source kernel-wedgesudo cp kernel-wedge /usr/bin/sudo cp lib/KernelWedge.pm /usr/lib64/perl5/vendor_perl/sudo mkdir /usr/share/kernel-wedge/ && sudo cp -r generic-rules commands/ /usr/share/kernel-wedge/
apt source autoconf2.69and install- follow steps in
debian/rules
- follow steps in
apt source dose-builddebcheckand install- needs ocaml :(((
dnf install ocaml ocaml-extlib-devel opamopam initeval $(opam env --switch=default) && opam install dune camlp-streamsdune pkg lock && dune buildsudo ln -s ~/.opam/default/bin/dose-builddebcheck /usr/bin/
apt source dctrl-toolsand installdnf install po4amake && make prefix=/usr install
apt source cdebconfand install- requires
apt source libdebian-installer4-dev- requires
dnf install check-devel
- requires
- requires
apt source dh-execdnf install libpipeline-devel
apt source gnulib- run things in
debian/rules rsync -a debian/gnulib/
- run things in
apt source autoconf-dickey./configure --prefix=/usr --program-suffix=-dickey --datadir=/usr/share/autoconf-dickey
apt source debhelperdh_missingis bad for us.sudo rm /usr/bin/dh_missing && sudo ln -s true /usr/bin/dh_missing
apt source dh-package-notessudo mkdir -p /usr/share/debhelper/dh_package_notes/sudo cp debian/debian-package-notes.specs debian/package-notes.mk /usr/share/debhelper/dh_package_notes/
apt source meson- we just need debcrossgen
mkdir -p /usr/share/meson && cp debian/debcrossgen /usr/share/meson/
apt source unicode-datamkdir build-tree && cd build-tree TZ=UTC unzip ../UCD.zip TZ=UTZ unzip ../Unihan.zip find . -name -name '*txt' | while read f; do tr -d \\r < $f > tmpf ; mv tmpf $f ; done bzip2 NormalizationTest.txt for d in Unihan*.txt; do bzip2 $d; done sudo mkdir -p /usr/share/unicode sudo rsync -ar build-tree/*.{txt,bz2} build-tree/extracted build-tree/auxiliary allkeys.txt decomps.txt emoji /usr/share/unicode/apt source docbook-to-manmake CFLAGS="-Wall -fcommon -std=gnu17" LDFLAGS="-Wl,--as-needed" ROOT=/usrmake ROOT=/usr install
apt source xutils-dev(thanks fedora, no more xorg in fedora)for i in *; do cd $i; ./configure --prefix=/usr; make -j4; sudo make install; cd ..; done
apt source xorg-sgml-doctools(ditto)apt source xtransapt source libx11sudo cp -r nls /usr/share/X11/locale
apt source xorgprotoapt source xorgsudo cp -r debian/local/ /etc/X11
apt source libxmusudo cp -r include/X11/Xmu /usr/include/X11/
apt source quilt(fedora's version is missing perl debhelper moduel)sudo install -D cp debian/quilt.pm /usr/share/perl5/vendor_perl/Debian/Debhelper/Sequence/quilt.pmsudo cp debian/dh_quilt_patch debian/dh_quilt_unpatch debian/dpatch2quilt debian/deb3 /usr/bin/sudo cp debian/quilt.debbuild.mk debian/quilt.make /usr/share/quilt/
apt source autotools-devsudo cp config.* /usr/share/misc/sudo cp -p debian/dh_autotools-dev_* /usr/bin/
apt source dh-builtusingsudo install -D builtusing.pm /usr/lib64/perl5/vendor_perl/Debian/Debhelper/Sequence/builtusing.pmsudo install -m 0755 dh_builtusing /usr/bin/
apt source dh-debputysudo dnf install python3-debian python3-colored python3-colorlogsudo pip install ruyaml
apt source dh-apparmorsudo install -D debian/debhelper/postinst-apparmor debian/debhelper/postrm-apparmor /usr/share/debhelper/autoscripts/sudo install -m 755 debian/debhelper/dh_apparmor /usr/bin/
apt source base-passwdsudo install -D passwd.master /usr/share/base-passwd/passwd.mastersudo install -D group.master /usr/share/base-passwd/group.master
apt source dh-nsssudo rsync -a autoscripts/ /usr/share/debhelper/autoscripts/sudo install -m 755 dh_installnss /usr/bin/sudo install -D installnss.pm /usr/share/perl5/Debian/Debhelper/Sequence/
apt source dh-pythonsudo dh binarysudo mkdir -p debian/dh-python/usr/share/perl5/vendor_perl/ && sudo mv debian/dh-python/usr/share/perl5/Debian debian/dh-python/usr/share/perl5/vendor_perl/sudo rsync -a debian/dh-python/usr/ /usr/
apt source gnome-pkg-toolssudo cp -a dh/dh_gnome dh/dh_gnome_clean /usr/bin/sudo cp dh/gnome.pm /usr/share/perl5/Debian/Debhelper/Sequence/sudo install -D control.header /usr/share/gnome-pkg-tools/control.header
apt source botch(actually, don't need this)eval $(opam env --switch=default) && opam install ocamlfind atdgen ocamlbuild xmlm extlib cudf bz2 camlzipsudo dnf install markdownmake && sudo make install
- remove
/usr/bin/update-alternativesand runapt source dpkgand install with default config (--prefix=/usr --sysconfdir=/etc)- this is done because the default configuration of dpkg with fedora is a bit broken with regards to install scripts :(
- and we need actual update-alternatives
- change
/etc/dpkg/origins/to usedebian- make
Vendor: Debianindefault
- make
mv /usr/bin/dpkg-shlibdeps{,.bak} && ln -s true /usr/bin/dpkg-shlibdeps- shlibdeps is variously broken
mkdir -p /usr/share/texmf/tex/texinfo/ && ln -s /usr/share/gnulib/build-aux/texinfo.tex /usr/share/texmf/tex/texinfo/sudo sed -i 's/#x.*;/#x0020;/' /usr/share/sgml/docbook/xml-dtd-4.5/ent/isogrk4.entsudo groupadd shadow- Apply this diff to pkg-config
--- /usr/bin/pkg-config.bak 2025-11-10 21:04:57.940116173 +1100 +++ /usr/bin/pkg-config 2025-11-10 21:05:17.519114214 +1100 @@ -5,4 +5,8 @@ ## Vendored definition of %_target_platform from redhat-rpm-config to avoid depending on it TARGET_PLATFORM=$(rpm --eval '%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}') +if [ "$1" = "pkg-config" ]; then + shift +fi + exec "/usr/bin/${TARGET_PLATFORM}-pkg-config" "$@" sudo dnf install perl-Locale-gettext perl-Config-Auto, thenapt source dpkg-crossandcp dpkg-cross /usr/bin/ cp -r Debian /usr/lib64/perl5/vendor_perl/ cp -r config /etc/dpkg-cross mkdir -p /etc/dpkg-cross/archtable.d/ cp config/archtable.default /etc/dpkg-cross/archtable.d/ touch /etc/dpkg-cross/cross-compile- move
/usr/include/asmout of the way and runln -s ../aarch64-linux-gnu/include/asm /usr/include/asm sudo ln -s automake-1.17 /usr/share/automake-1.18(Or just have 1.18 installed)sudo touch /etc/debian_version- things that are otherwise very annoying to deal with
apt install binutils-common libcc1-0 gfortran-15 binutils-for-build g++-for-build debhelper docbook docbook-utils po4a less po-debconf dh-autoreconf docbook2X dh-exec mawk autopoint autoconf-archive cmake x11proto-dev xutils-dev meson gtk-doc-tools scdoc dh-package-notes gengetopt systemd-dev unicode-data dh-sequence-movetousr libgpm-dev autotools-dev texi2html readline-common lynx tcl8.6-dev tzdata udev systemd cron cracklib-runtime docbook-xml rename docbook-xsl libfl-dev patchelf indent libpam0g-dev debconf libpod-pom-view-restructured-perl groff-base python3-sphinx bison bsdextrautils dh-apparmor groff python3-lxml python3-debian python3-docutils python3-packaging swig libaudit-common fig2dev imagemagick librsvg2-bin asciidoctor ninja-build triehash xcb-proto python3-xcbgen xmlto xorg-sgml-doctools w3m ninja-build triehash libx11-data xtrans-dev x11-common x11proto-core-dev fontconfig-config libxmu-headers-
for i in dh-sequence-gnome dh-sequence-python3 dh-sequence-installnss dh-sequence-movetousr dh-sequence-builtusing dh-sequence-installsysusers dh-sequence-zz-debputy-rrr; do fake-install $i 0 foreign done fake-install dpkg-build-api 1 foreign- gcc die
g++-multilib libc6-dev-i386 lib32gcc-s1 libc6-dev-x32 libx32gcc-s1 libc6-dbg m4 lzma gperf nvptx-tools amdgcn-tools-19 locales-all netbase cargo libisl-dev lib32z1-dev unzip git python3-pytest python3-check-jsonschema libgc-dev doxygen graphviz ghostscript texlive-latex-base xsltproc libxml2-utils docbook-xsl-ns binutils-hppa64-linux-gnu gnat-14 g++-14 gdc-14
- should be able to run modified bootstrap.sh now
- might die due to
pkgconf,dnf reinstall pkgconf pkg-configgets it through - manual install of /tmp/repo/pool/main/libe/libevent/libevent-2.1-7t64_2.1.12-stable-10_arm64.deb may be required
- manual install /tmp/repo/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.28+dfsg1-10_arm64.deb /tmp/repo/pool/main/c/cyrus-sasl2/libsasl2-modules-db_2.1.28+dfsg1-10_arm64.deb may be required
- move
/usr/include/asmout of the way and runln -s ../aarch64-linux-gnu/include/asm /usr/include/asm<-- undo and redo as needed - may need to remove
+bNfrom/var/lib/dose/liststo make things happy on occassion?
- might die due to
- remove arch-test
sudo rm /usr/bin/arch-test && sudo ln -s true /usr/bin/arch-test sudo debootstrap --foreign --no-check-sig --variant=minbase --arch arm64 rebootstrap /debian file:///tmp/repo/find /tmp/repo/pool/main/ -name "*.deb" -print -exec sudo dpkg-deb -x {} /debian \;sudo chroot /debian!!!!!- current status:
build-essentialstill does not build properly thus far, for unknown reasons, cannot make much progress without having a workingbuild-essential - future plans
- port to Gentoo as base instead of Fedora
- remove some of the most hacky things
- figure out how to bootstrap same instead of different architecture (i386??)
- setup apt
Created
November 12, 2025 07:44
-
-
Save fosslinux/9db7a8c318b89bdbc879d3e9b199ac0e to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment