Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
1 answers
5134 views
Configure GRUB to load in QEMU
I have a a debootstrapped Debian image, which is created using the following commands: ```bash qemu-img create -f qcow2 disk.qcow2 16G su export PATH=$PATH:/sbin:/usr/sbin export TERM=xterm modprobe nbd qemu-nbd --connect=/dev/nbd0 disk.qcow2 --cache=unsafe --discard=unmap parted --align optimal --s...
I have a a debootstrapped Debian image, which is created using the following commands:
qemu-img create -f qcow2 disk.qcow2 16G

su

export PATH=$PATH:/sbin:/usr/sbin
export TERM=xterm

modprobe nbd
qemu-nbd --connect=/dev/nbd0 disk.qcow2 --cache=unsafe --discard=unmap
parted --align optimal --script --machine --fix /dev/nbd0 -- \
       mklabel gpt \
       mkpart efi fat32 '0%' 500MiB \
       set 1 boot on \
       mkpart swap linux-swap 500MiB 1GiB \
       mkpart root ext4 1GiB '100%'
mkfs.vfat -F 32 /dev/nbd0p1
mkswap /dev/nbd0p2
mkfs.ext4 /dev/nbd0p3

mkdir -p disk
mount /dev/nbd0p3 disk

debootstrap --arch amd64 bullseye ./disk
mkdir -p ./disk/boot/efi
mount /dev/nbd0p1 ./disk/boot/efi
mount --bind /dev ./disk/dev
mount -t devpts /dev/pts ./disk/dev/pts
mount -t proc proc ./disk/proc
mount -t sysfs sysfs ./disk/sys
mount -t tmpfs tmpfs ./disk/tmp

chroot ./disk

echo -e 'password\npassword' | passwd

echo debian > /etc/hostname

UUID1=$(blkid /dev/nbd0p1 | grep -Eo ' UUID="[^ ]*"' | sed 's/[" ]//g')
UUID2=$(blkid /dev/nbd0p2 | grep -Eo ' UUID="[^ ]*"' | sed 's/[" ]//g')
UUID3=$(blkid /dev/nbd0p3 | grep -Eo ' UUID="[^ ]*"' | sed 's/[" ]//g')
echo "none /tmp tmpfs defaults 0 0" > /etc/fstab
echo "$UUID1 /boot/efi vfat defaults 0 2" >> /etc/fstab
echo "$UUID2 none swap sw 0 0" >> /etc/fstab
echo "$UUID3 / ext4 errors=remount-ro 0 1" >> /etc/fstab

cat > /etc/apt/sources.list  /etc/systemd/network/80-dhcp.network > /etc/default/grub
update-grub2

exit

for dev in tmp sys proc dev/pts dev boot/efi; do
    umount ./disk/$dev
done

umount disk
rmdir disk
qemu-nbd --disconnect /dev/nbd0

exit
I can successfully run this image when I copy kernel and initrd images from the drive and start them directly using the command
qemu-system-x86_64 \
    -drive format=qcow2,file=disk.qcow2 \
    -kernel vmlinuz \
    -initrd initrd.img \
    -cpu host -M q35  \
    -enable-kvm \
    -m 2G,maxmem=4G \
    -device rtl8139,netdev=network0 \
    -netdev user,id=network0 \
    -append "root=/dev/sda3"
But when I try to start this disk using GRUB with [SeaBIOS](https://www.coreboot.org/SeaBIOS) (default QEMU BIOS) with command
qemu-system-x86_64 \
    -drive format=qcow2,file=disk.qcow2 \
    -boot c  \
    -cpu host -M q35  \
    -enable-kvm \
    -m 2G,maxmem=4G \
    -device rtl8139,netdev=network0 \
    -netdev user,id=network0
it gets stuck at Booting from Hard Disk... line. When using [OVMF EFI](https://packages.debian.org/bullseye/ovmf) with command
qemu-system-x86_64 \
    -drive format=qcow2,file=disk.qcow2 \
    -boot c  \
    -bios /usr/share/ovmf/OVMF.fd \
    -cpu host -M q35  \
    -enable-kvm \
    -m 2G,maxmem=4G \
    -device rtl8139,netdev=network0 \
    -netdev user,id=network0
I get error lines
BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00005 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x2,0xFFFF,0x0): Not Found
BdsDxe: failed to load Boot0002 "UEFI QEMU HARDDISK QM00001 " from PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x0,0xFFFF,0x0): Not Found
How do I make my disk to load with GRUB?
Sergey (383 rep)
Oct 1, 2022, 07:13 AM • Last activity: Feb 22, 2025, 01:17 PM
0 votes
0 answers
185 views
How do you generate a keyring file for a local APT repository?
Based on [this answer](https://unix.stackexchange.com/a/775900/384822), I followed [this guide](https://earthly.dev/blog/creating-and-hosting-your-own-deb-packages-and-apt-repo/) to create a local apt repository. Now I an specifying that `debootstrap` use my repository with `file:path/to/my/apt/repo...
Based on [this answer](https://unix.stackexchange.com/a/775900/384822) , I followed [this guide](https://earthly.dev/blog/creating-and-hosting-your-own-deb-packages-and-apt-repo/) to create a local apt repository. Now I an specifying that debootstrap use my repository with file:path/to/my/apt/repo. When debootstrap runs, I get this:
I: Target architecture can be executed
I: Retrieving InRelease 
I: Checking Release signature
E: Release signed by unknown key (key id ***REDACTED***)
   The specified keyring /files/raspberrypi.gpg may be incorrect or out of date.
   You can find the latest Debian release key at https://ftp-master.debian.org/keys.html 
For some background, I am using [pi-gen](https://github.com/RPi-Distro/pi-gen) to generate raspberry pi images. They provide a file called raspberrypi.gpg, which I believe is the keyring for raspbian.raspberrypi.com. However, I want to use my local apt repo instead of the public internet one. So I am replacing http://raspbian.raspberrypi.com/raspbian with file:path/to/my/apt/repo so that debootstrap will be able to pull packages from my local apt repo instead of pulling them from the internet. So essentially I think I need to create an equivalent my-apt-repo.gpg file, but all I have after following the above linked tutorial is the following: - Release, which I think is the header of my apt repo - Release.gpg, which I think is a signed version of Release - InRelease, which I think is a combination of Release and Release.gpg - my-pgp-key.private which is the private key I used to sign the Release file - my-pgp-key.public which is the public key corresponding to the private key So somehow from these I think I need to create my-apt-repo.gpg which should allow me to actually use the apt repo. But I do not know how to create this file.
nullromo (111 rep)
Jan 14, 2025, 11:11 PM • Last activity: Jan 15, 2025, 08:38 PM
0 votes
0 answers
41 views
How do I create a restorable Clonezilla image from a rootfs directory?
I've built a Debian rootfs for an embedded Linux platform using `debootstrap` et al. My goal is to make this installable to my devices over the network. I previously built [my own solution](https://github.com/rgov/netinstall) using iPXE but I'm evaluating switching to Clonezilla. However, I am not c...
I've built a Debian rootfs for an embedded Linux platform using debootstrap et al. My goal is to make this installable to my devices over the network. I previously built [my own solution](https://github.com/rgov/netinstall) using iPXE but I'm evaluating switching to Clonezilla. However, I am not cloning an existing drive; I want to make the restorable image from my rootfs directory, and populate the necessary metadata fields about the partitions for Clonezilla to recreate on restore. What is the process for "manually" creating a Clonezilla restore image? E.g., should I create a disk image with mkfs && mount -o loop and then clone it? Is there some incantation of partclone that supports this? (A process that doesn't require root and/or that works inside a Docker container would be preferred, since that's easier to deploy via CI.)
rgov (253 rep)
Nov 4, 2024, 10:25 PM • Last activity: Nov 4, 2024, 10:54 PM
0 votes
0 answers
154 views
How does one turn a debootstrap rootfs into a bootable custom EFI ISO with GRUB?
I'm experimenting with creating a "custom" specific-purpose Linux distro based on Debian (Clonezilla-style, or even GPartedOS-style). In my case, it's a Python script that runs at boot. Right now, it's a simple "Hello, World!" application that refreshes the screen with how many seconds the script ha...
I'm experimenting with creating a "custom" specific-purpose Linux distro based on Debian (Clonezilla-style, or even GPartedOS-style). In my case, it's a Python script that runs at boot. Right now, it's a simple "Hello, World!" application that refreshes the screen with how many seconds the script has been running (just as a test). I've created a script to generate a rootfs as well as compile and install Python 3.11 within it: # Boot image build script # Builds a small, specific-purpose bootable (UEFI-only) x64 ISO based on Debian. # This script currently only supports running on Debian hosts!!! set -e ROOT_DIR="rootfs" # Run debootstrap to create the rootfs if it doesn't exist [ ! -d $ROOT_DIR ] && sudo debootstrap --arch=amd64 buster $ROOT_DIR set +e # if this isn't here, any future failure will cause the script to stop, and the temporary directories won't be unmounted, which means host system will slowly break down until a reboot. # Enter CHROOT and modify rootfs cat /var/lib/dbus/machine-id apt-get install linux-image-amd64 live-boot linux-headers-amd64 grub-efi -y # apt-get install python3 apt-get clean -y EOF PYTHON_INSTALL_SCRIPT=$( cat build-python.sh ) cat build-python.sh | sudo chroot $ROOT_DIR cat << EOF | sudo chroot $ROOT_DIR # Cleanup before we leave rm /var/lib/dbus/machine-id && rm -rf /tmp/* umount /proc /sys /dev/pts EOF My goal is to turn this into a bootable UEFI-only ISO with GRUB, since this image will have tools not compatible with BIOS/CSM systems. How do I turn this into a bootable GRUB ISO image (I might want the final ISO image to have some extra files in it, so the ISO will be created from a directory.)
Joseph .M 101 (101 rep)
Oct 2, 2024, 03:12 PM
0 votes
1 answers
6939 views
How to reinstall / repair Debian after a failed upgrade?
I followed [this wiki][1] tried to upgrade Debian 10 to 11 then 12, but for some reason some part messed up the system and now it can't boot (kernel panic) and entire system is messed up: no `apt` available, no `vi` available etc. I am trying to use Debian 12 installer to repair it, trying to use it...
I followed this wiki tried to upgrade Debian 10 to 11 then 12, but for some reason some part messed up the system and now it can't boot (kernel panic) and entire system is messed up: no apt available, no vi available etc. I am trying to use Debian 12 installer to repair it, trying to use its rescue mode to reinstall OS. What I tried was: 1. Boot rescue mode with boot disk and try to install minimum dependency like apt but it doesn't work. Too much dependencies 2. I am also working with the debootstrap to reinstall the target disk, but that too got stuck at "Chosen extractor for .deb packages: ar" and failed. What is the best way to reinstall and/or repair this entire Debian OS and make the old OS working again?
Draven (1 rep)
Jun 22, 2023, 07:05 PM • Last activity: Jun 16, 2024, 12:05 AM
2 votes
2 answers
6077 views
What are the possible options for the --arch option in debootstrap?
I need to set the arch option in debootstrap. So I did some research and read the manual. After reading the [manual][1] I see that the section on the options simply says --arch=ARCH Implying that I should know the correct syntax for the architecture I need. I don't. I need 64 bit architecture. I kno...
I need to set the arch option in debootstrap. So I did some research and read the manual. After reading the manual I see that the section on the options simply says --arch=ARCH Implying that I should know the correct syntax for the architecture I need. I don't. I need 64 bit architecture. I know that "i386" can be used for 32bit architecture. What should I set the --arch option to if I want 64 bit architecture? Or more generally what would the range of options be? I could guess (but don't know and can't determine) that potentially the range or arch options depends on the OS being booted. In my case its a version of ubuntu that I know should work in 64bit. So the question becomes how would I determine the 64bit architecture option syntax? I could further guess (but again don't know and can't determine) that the option syntaxes are actually supplied by the booted OS and if I knew where to look I could figure it out. In which case, where would I look?
Mr Purple (153 rep)
Dec 15, 2018, 08:03 PM • Last activity: Nov 2, 2023, 09:26 PM
1 votes
1 answers
581 views
Mirror download fails with error: Failed getting release file while running debootstrap with sudo
I run the command ``` $ sudo debootstrap --variant=buildd --arch i386 lucid /var/chroot/ https://mirror.internet.asn.au/pub/ubuntu/archive/ ``` and the error is: ``` I: Retrieving InRelease I: Retrieving Release E: Failed getting release file https://mirror.internet.asn.au/pub/ubuntu/archive/dists/l...
I run the command
$ sudo debootstrap --variant=buildd --arch i386 lucid /var/chroot/ https://mirror.internet.asn.au/pub/ubuntu/archive/ 
and the error is:
I: Retrieving InRelease 
I: Retrieving Release 
E: Failed getting release file https://mirror.internet.asn.au/pub/ubuntu/archive/dists/lucid/Release 
I've tried with other mirrors too. I've also read the similar issue , but I don't understand the answer?
user1416486 (35 rep)
Sep 23, 2023, 12:52 PM • Last activity: Sep 23, 2023, 01:26 PM
0 votes
1 answers
1429 views
What debian ARCH should I use for armv7l kernel?
``` debootstrap --arch=ARCH stable debian-stable http://ftp.debian.org/debian/ ``` `debootstrap` requires architecture to be set. Debian supports `armel` and `armhf` architectures of ARM 32-bit family. Which one to choose for `armv7l` Linux? (in case it's generally supported at all).
debootstrap --arch=ARCH stable debian-stable http://ftp.debian.org/debian/ 
debootstrap requires architecture to be set. Debian supports armel and armhf architectures of ARM 32-bit family. Which one to choose for armv7l Linux? (in case it's generally supported at all).
R A (103 rep)
Jul 12, 2023, 11:33 AM • Last activity: Jul 12, 2023, 12:06 PM
0 votes
1 answers
317 views
Script to install Debian has UEFI issues, acts inconsistently across machines
For my own personal purposes, I am writing a script in order to automate installation of a custom Debian system onto the hard drive of whatever computer the script is running on. This script is intended to be used from any live Linux distribution. I am aware of Debian preseeding - unfortunately, pre...
For my own personal purposes, I am writing a script in order to automate installation of a custom Debian system onto the hard drive of whatever computer the script is running on. This script is intended to be used from any live Linux distribution. I am aware of Debian preseeding - unfortunately, preseeding is not a viable solution in this situation. The script works. However, it does not work consistently. On some machines (for example, my 2011 Macbook Air), the new EFI configuration is updated without any issues. However, on some machines (notably newer Dell laptops), I have to go into the BIOS and manually add my \EFI\debian\grubx64.efi file. How would I alter the below script in order to accommodate most modern UEFI systems? I am aware that I will likely need to alter my efibootmgr commands below. #!/bin/bash # Preliminary commands set -e echo "Available disks:" current_disk=$(df / | awk 'NR==2 {print $1}') for disk in $(lsblk -dnro NAME,TYPE | awk '$2=="disk" {print $1}'); do if [ "$disk" != "${current_disk#/dev/}" ]; then size=$(lsblk -dnro SIZE "/dev/$disk") echo "/dev/$disk: $size" fi done read -p "Enter the disk you want to install Debian on (e.g. /dev/sda): " disk mkdir -p /mnt sgdisk --zap-all "$disk" > /dev/null parted "$disk" mklabel gpt parted "$disk" mkpart ESP fat32 0% 512MB parted "$disk" mkpart primary ext4 512MB 100% # Set up main partition yes | mkfs.ext4 "${disk}2" mount "${disk}2" /mnt # Set up EFI partition yes | mkfs.fat -F32 "${disk}1" mkdir -p /mnt/efi mount "${disk}1" /mnt/efi debootstrap --arch=amd64 buster /mnt http://ftp.us.debian.org/debian/ # Set up bindings mount --bind /dev /mnt/dev mount --bind /proc /mnt/proc mount --bind /sys /mnt/sys # Chroot to set up grub chroot /mnt /bin/bash << "EOT" apt update -y apt install -y linux-image-amd64 grub-efi-amd64 grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=debian --recheck --no-floppy update-grub EOT # Set the path to your .EFI file efi_file="\EFI\debian\grubx64.efi" bootnum=$(efibootmgr -v | grep "Boot" | awk '{print $1}' | sed 's/Boot//g' | sort -n | tail -1 | awk '{print $1+1}') efibootmgr -c -d "$disk" -p 1 -L "Debian" -l "${efi_file}" -b "${bootnum}" efibootmgr -o "${bootnum}" # Unmount bindings umount -l /mnt/sys umount -l /mnt/proc umount -l /mnt/dev # Unmount filesystems umount -l /mnt/efi umount -l /mnt reboot
Ethan Hill (131 rep)
Apr 13, 2023, 11:46 AM • Last activity: Apr 13, 2023, 01:05 PM
11 votes
3 answers
10464 views
Is it possible to run debootstrap within a fakeroot environment?
I have a script that prepares an installation image by running `debootstrap`, does some modifications on the files and then copies the files to a disk image backed up by a file. This works under `root`, but I wanted to be able to run the script without `root` privileges, as it really shouldn't need...
I have a script that prepares an installation image by running debootstrap, does some modifications on the files and then copies the files to a disk image backed up by a file. This works under root, but I wanted to be able to run the script without root privileges, as it really shouldn't need any privileged resources. I thought that I'd just run the whole script using fakeroot, but debootstrap fails with W: Failure trying to run: chroot /tmp/tmp..... mount -t proc proc /proc Is there a way around that?
Petr (1776 rep)
Jul 9, 2015, 09:57 AM • Last activity: Apr 11, 2023, 11:10 AM
0 votes
1 answers
235 views
Install mmdebstrap from source
I am trying to install `mmdebstrap` from source. I cannot find any instructions online nor file any `Makefile`s and such in the [repo][1] [1]: https://gitlab.mister-muffin.de/josch/mmdebstrap
I am trying to install mmdebstrap from source. I cannot find any instructions online nor file any Makefiles and such in the repo
sudoer (65 rep)
Jan 11, 2023, 10:00 AM • Last activity: Jan 11, 2023, 10:31 AM
1 votes
0 answers
402 views
Different versions of ubuntu with chroot environment
I was trying to setup a chroot environment on older system using debootstrap. I had ubuntu 14.04 and I was wondering what version of ubuntu i can possibly install on it. If I were to try and run ubuntu 20.04 should there be any risk for the host system? And more generally, how far apart can the vers...
I was trying to setup a chroot environment on older system using debootstrap. I had ubuntu 14.04 and I was wondering what version of ubuntu i can possibly install on it. If I were to try and run ubuntu 20.04 should there be any risk for the host system? And more generally, how far apart can the versions be - is there any limit at all? While the problem was solved by simply upgrading the old system (about time) the question remains. When I tried to set it up i used debootstrap to create chroot folder in something like
/root/${distro}-root
, then I mounted folders as in [here](https://wiki.debian.org/Debootstrap) . I then run chroot on that folder. Everything worked as intended. After that though when I rebooted the host system it would not boot up.
pnikonowicz (11 rep)
Jan 4, 2023, 08:43 AM • Last activity: Jan 9, 2023, 05:05 AM
0 votes
1 answers
1443 views
How to install packages into chroot?
This question is related to https://unix.stackexchange.com/questions/726675/debootstrap-variant-buildd-coulnt-find-build-essential As I know debootstrap may run the script after or before creating chroot debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] Ppl told me that I can place packages ins...
This question is related to https://unix.stackexchange.com/questions/726675/debootstrap-variant-buildd-coulnt-find-build-essential As I know debootstrap may run the script after or before creating chroot debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] Ppl told me that I can place packages installation into this script to install required packages. Please tell me how to do that, to fix the dependencies?
Ekaterina Ivanova iceja.net (260 rep)
Dec 2, 2022, 06:16 PM • Last activity: Dec 24, 2022, 05:24 PM
0 votes
0 answers
345 views
debootstrap --variant=buildd couln't find build-essential
I am preparing chroot sudo debootstrap --verbose --include=apt --cache-dir=/var/cache/pbuilder/alse47-arm64/aptcache --variant=buildd --no-check-gpg --components=main,contrib,non-free,arm64 4.7_arm /home/user/PROSTOR/pkg-csp/builplace https://dl.astralinux.ru/astra/stable/4.7_arm/repository-base wit...
I am preparing chroot sudo debootstrap --verbose --include=apt --cache-dir=/var/cache/pbuilder/alse47-arm64/aptcache --variant=buildd --no-check-gpg --components=main,contrib,non-free,arm64 4.7_arm /home/user/PROSTOR/pkg-csp/builplace https://dl.astralinux.ru/astra/stable/4.7_arm/repository-base with following logs https://gist.githubusercontent.com/iva-nova-e-katerina/ef950310535f0ee9f3fa76853aa635b0/raw/b8b61dd16037a14ad5996e7f853727a0408e52f7/sudo%2520debootstrap%2520--verbose debootstrap.log: https://gist.githubusercontent.com/iva-nova-e-katerina/4881c9a15bb43c399e12c3a616e4cc6a/raw/957072a03913cd3ffd953da227cbfb52665b5c40/debootstrap.log I know for sure where build-essential is sudo apt show build-essential Package: build-essential Version: 12.6 Priority: optional Section: devel Maintainer: Matthias Klose Installed-Size: 20.5 kB Depends: libc6-dev | libc-dev, gcc (>= 4:8.3), g++ (>= 4:8.3), make, dpkg-dev (>= 1.17.11) Download-Size: 7,588 B APT-Manual-Installed: yes APT-Sources: http://dl.astralinux.ru/astra/stable/4.7_arm/repository-base 4.7_arm/main arm64 Packages But still can not create chroot. Could you help me to do that? **UPD** sudo apt show linux-libc-dev-5.10.0-1057 Package: linux-libc-dev-5.10.0-1057 Version: 5.10.0-1057.astra6+ci79 Priority: optional Section: devel Source: linux-5.10 Maintainer: JSC RPA RusBITech Installed-Size: 6,298 kB Provides: aufs-dev, linux-kernel-headers, linux-libc-dev Conflicts: linux-kernel-headers Replaces: linux-kernel-headers Download-Size: 1,535 kB APT-Manual-Installed: yes APT-Sources: http://dl.astralinux.ru/astra/stable/4.7_arm/repository-base 4.7_arm/main arm64 Packages sudo debootstrap --verbose --include=apt --cache-dir=/var/cache/pbuilder/alse47-arm64/aptcache --variant=buildd --no-check-gpg --components=arm64 4.7_arm/main /home/user/PROSTOR/pkg-csp/builplace https://dl.astralinux.ru/astra/stable/4.7_arm/repository-main E: No such script: /usr/share/debootstrap/scripts/4.7_arm/main
Ekaterina Ivanova iceja.net (260 rep)
Nov 29, 2022, 08:01 AM • Last activity: Nov 29, 2022, 12:12 PM
2 votes
1 answers
2037 views
Live debian USB stick with debootstrap, squashfs and grub
I want to create my own Debian Live boot stick from a chroot (debootstrap) environment. The root filesystem should be mounted as squashfs and grub should be able to boot the system from a single EFI partition. So far, I have a squashfs image of the chroot environment, vmlinuz and initrd.img on the s...
I want to create my own Debian Live boot stick from a chroot (debootstrap) environment. The root filesystem should be mounted as squashfs and grub should be able to boot the system from a single EFI partition. So far, I have a squashfs image of the chroot environment, vmlinuz and initrd.img on the stick. However, I don't know, how I have to configure grub so that it doesn't boot my local system (tried with: grub-install...) but instead the squashfs of the USB stick.
user547272
Oct 31, 2022, 01:39 AM • Last activity: Nov 2, 2022, 06:45 PM
0 votes
0 answers
414 views
Creating docker image of my system in its current state
I want to create a docker image of my own system in its current state. [Here][1], i found a method that uses the [debootstrap tool][2] to create an image: $ sudo debootstrap focal focal > /dev/null $ sudo tar -C focal -c . | docker import - focal According to debootstrap documentation: debootstrap [...
I want to create a docker image of my own system in its current state. Here , i found a method that uses the debootstrap tool to create an image: $ sudo debootstrap focal focal > /dev/null $ sudo tar -C focal -c . | docker import - focal According to debootstrap documentation: debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] debootstrap bootstraps a basic Debian system of SUITE into TARGET from MIRROR by running SCRIPT. MIRROR can be an http:// or https:// URL, a file:/// URL, or an ssh:/// URL., a file:///(...) i am no expert in operational systems, so it isnt clear to me if this tool works as i intend. Trying to copy all my system i naively tried: sudo debootstrap / my_system > /dev/null in the hopes that, since files are accepted, "/" would represent my root directory and all would be used by debootstrap. It didnt work. It just generated a folder called my_system with a subfolder called debootstrap and a file called debootstrap.log with the content: > /usr/sbin/debootstrap: 484: : Permission denied any tips on how to do this or suggestion of better tools to create docker images of my current installation? Edit after Virsacer comment about X-Y question: Adding context: the need to create a docker image from my system came because a given project has fallen into my hands and i need to understand the project quickly. My main idea was to create an environment that would simulate the project operating environment so that i could test new implementations and, in general, make modifications without screwing things up. Three main things make my job difficult: 1 - It is not just a set of codes. The operating environment itself is part of the project since its made to control and monitor in-house made hardware. 2 - It is not well documented. I have little detail about what services need to be running, what environment vars need to be set, etc. for the whole project to work. 3 - The only testing environments i have right now are the ones that are already being used, so testing is pretty limited to not affect current operation. I had two strategies in mind to be able to create my simulating environment: making an ISO image of the system and making a docker image of the system. Making an ISO image seems plausible, but i wanted to 1 - Seize the oportunity to learn something new; 2 - Have the redundancy of creating the environment in two different working ways. 3 - Have the container as a more portable way of replicating the environment when needed. So i thought about creating the image, continuously getting rid of anything that doesnt seem needed for the project, testing and creating a new, lighter image if testing results successful.
Marco Montevechi Filho (187 rep)
Aug 13, 2022, 03:29 PM • Last activity: Aug 13, 2022, 05:18 PM
0 votes
1 answers
257 views
Error while building *.deb package in separate build environment
I'm trying to build *.deb packages into a chroot. When building the first package - bash, there were difficulties. I build packages using debootstrap and chroot. - I install debootstrap: sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/; - I install the packages I need: apt -y ins...
I'm trying to build *.deb packages into a chroot. When building the first package - bash, there were difficulties. I build packages using debootstrap and chroot. - I install debootstrap: sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/ ; - I install the packages I need: apt -y install wget dpkg-dev devscripts dh-make locales; - Configure locale; - Configure /etc/apt/source.list - add deb-src http://deb.debian.org/debian bullseye main - Downloading the source to build - apt source bash(or using wget from the debian website) - Install build dependency - apt build-dep bash - And, finally, build - debuild -b(also tried with dpkg-buildpackage) As a result, I get this error when building a bash package: > mkdir -p stamps : # see #327477, needed to have HAVE_DEV_STDIN defined (test -d /dev/fd && test -r /dev/stdin < /dev/null) \ || (test -d /proc/self/fd && test -r /dev/stdin < /dev/null) make: *** [debian/rules:102: before-build] Error 1 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 I tried to find it on the Internet, but did not succeed, and my knowledge is not enough to understand the essence of this error on my own. Tell me, please, maybe I have to tweak something in the build environment or do I need some additional packages?
Darron (113 rep)
Jul 13, 2022, 07:58 AM • Last activity: Jul 13, 2022, 09:56 AM
5 votes
2 answers
2208 views
fakeroot cdebootstrap: Failed to unshare: Operation not permitted
On Debian, when running: $ fakeroot cdebootstrap stable /tmp/foo cdebootstrap downloads the packages, but when it has to extract them, I get this error: E: Failed to unshare: Operation not permitted How can I run cdebootstrap as non-root? This part in unshare's manual seems relevant, but am not sure...
On Debian, when running: $ fakeroot cdebootstrap stable /tmp/foo cdebootstrap downloads the packages, but when it has to extract them, I get this error: E: Failed to unshare: Operation not permitted How can I run cdebootstrap as non-root? This part in unshare's manual seems relevant, but am not sure how: EPERM (since Linux 3.9) CLONE_NEWUSER was specified in flags and the caller is in a chroot environment (i.e., the caller's root directory does not match the root directory of the mount namespace in which it resides).
Florian Margaine (523 rep)
Jul 29, 2015, 09:47 PM • Last activity: Jul 11, 2022, 12:51 PM
1 votes
1 answers
209 views
Subprocess launched inside a chroot created on a codespace with debootstrap fail with /dev/fd/62: No such file or directory
My goal is to standup a chroot with the basic Unix tool-set (`bash`, `cp`, `touch`, `cat`, etc) and any necessary dependencies need to run `apt get` inside a codespace. Using debootstrap gets me close. The basic tools are installed and I can run `apt get`. The problem is subprocess do not work. I ex...
My goal is to standup a chroot with the basic Unix tool-set (bash, cp, touch, cat, etc) and any necessary dependencies need to run apt get inside a codespace. Using debootstrap gets me close. The basic tools are installed and I can run apt get. The problem is subprocess do not work. I expect the last line to print "test" but actually I get an error saying that the subprocess' file handle is no good. I would have thought the vanilla debootstrap environment would be sufficiently cooked so that subprocess work, but that does not seem to be the case. Is there a switch I can pass?
$ sudo apt-get install -y binutils debootstrap
$ cd /home/codespace
$ CHROOT=/home/codespace/chroot
$ mkdir -p "${CHROOT}"
$ sudo debootstrap stable "${CHROOT}" http://deb.debian.org/debian/ 
$ sudo chroot "${CHROOT}"
$ cat < <(echo test)
bash: /dev/fd/63: No such file or directory
To reproduce, - sign up for codespaces beta [here](https://github.com/features/codespaces/signup) . - fire up a codespace for [this project](https://github.com/kingces95/chroot-mounts) , open a bash shell (ctrl+`). - run the above. This also reproduces outside of codespace so any Ubuntu environment will probably yield similar results.
Christopher King (252 rep)
Jun 30, 2022, 02:21 AM • Last activity: Jul 1, 2022, 11:52 PM
5 votes
2 answers
3588 views
List of Debian packages with essential priority
From my understanding, the `debootstrap` program with the `minbase` option only installs packages with "essential priority" (and possibly `apt`). Is there a web resource which lists all packages with different priority levels? All I really need is a list for priority levels of essential, required, i...
From my understanding, the debootstrap program with the minbase option only installs packages with "essential priority" (and possibly apt). Is there a web resource which lists all packages with different priority levels? All I really need is a list for priority levels of essential, required, important, and standard and I do not need optional and extra.
StrongBad (5491 rep)
Nov 14, 2017, 08:58 PM • Last activity: May 30, 2022, 02:19 PM
Showing page 1 of 20 total questions