Skip to content

Instantly share code, notes, and snippets.

@pastcompute
Last active December 5, 2016 10:23
Show Gist options
  • Save pastcompute/4004821ca248db14baf809b6ec4be1df to your computer and use it in GitHub Desktop.
Save pastcompute/4004821ca248db14baf809b6ec4be1df to your computer and use it in GitHub Desktop.
Build Debian i386 target for compact flash

Note: requires sudo or root unfortunately, no amount of munging of fakechroot, fakeroot, qemu or linux32 could get the second stage to run as a normal user.

/usr/sbin/debootstrap --no-check-gpg --arch i386 stable target-dir file:///path/to/mounted/dvd
cp /etc/apt/sources.list.d/my-sources target-dir/etc/apt/sources.list.d # or echo correct item
fuseiso file:///path/to/mounted/dvd target-dir/mnt/debian-cd
RUNLEVEL=1 LANG=C sudo chroot target-dir
apt-get update
apt-get install -y apache2 samba htop ufw localepurge bash-completion curl squid3 dnsmasq grub2
apt-get install -y linux-image-3.16.0-4-586
# update-initramfs seems to be superfluous, called by installation of linux-image-...
# Do other installation
exit
# Copy other config files
  1. Option: create an image and DD it across. Good for multiple copies
  2. Option: fileystems already exist, with optimised sector offsets, instead, quick format and use rsync. Then, upgrade grub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment