Closed lpaolini closed 2 years ago
Hello Luca, what would be the purpose of debian_buster_installer (how do expect to use this file in practice) ? Arnaud
To reinstall Debian from scratch, in case I need it. Doesn't it make sense?
but how do you use the debian_buster_installer
file ?
On which state are you starting your install (from a QNAP firmware or on a QNAP with debian already installed) ?
For example, cp kernel-6281 /dev/mtd3
will not work on a debian (not even sure it will work on QNAP firmware). /dev/mtd3 is a MTD device. you don't write on it like a HDD. you have to use special tools that erase the device before writing on it (ie. flashcp, flash_erase)
what you need to install the debian installer from a already installed debian firmware is:
flashcp -v kernel-6281 /dev/mtd1
flashcp -v initrd /dev/mtd2
reboot
You don't need to care about padding.
Be very careful to not write or erase /dev/mtd0. Your QNAP will not boot
Ok, I got it, at last. Many thanks @amouiche for explaining.
If you expect to use the QNAP recovery features (ie. press reset button during poweron), and present this 'image' file with a TFTP server, you must know that the bootloader doesn't flash the whole file, but only fixed parts:
- 2MB of the expected kernel partition
- 9MB of rootfs
This obviously makes it impossible to create an image based on modified mtd partitions which can be restored using QNAP recovery mode.
Hi Arnaud,
I've successfully updated a TS-219p and a TS-221 using your script, so thanks again! Now, how can I build a Debian buster installer image for the new partition table?
I tried different methods, but with no success.
Method 1: 1) downloaded kernel-6281 (on TS-219p) and padded it to 3MB with
truncate -s 3145728 kernel-6281
2) downloaded initrd and padded it to 12MB withtruncate -s 12582912 initrd
3) created an image withcat /dev/mtd0 /dev/mtd4 /dev/mtd5 kernel-6281 initrd > debian_buster_installer
Method 2: 1) downloaded kernel-6281 (on TS-219p) and padded it to 2MB with
truncate -s 2097152 kernel-6281
2) downloaded initrd and padded it to 12MB withtruncate -s 12582912 initrd
3) copied the padded kernel to "Kernel_legacy" partition withcp kernel-6281 /dev/mtd3
4) copied the padded initrd to "RootFS1" partition withcp initrd /dev/mtd2
5) created an image withcat /dev/mtd0 /dev/mtd4 /dev/mtd5 /dev/mtd1 /dev/mtd2 > debian_buster_installer
Obviously I'm doing something wrong, as they both fail the CRC check (Bad magic number) while trying to boot.
Any ideas? Thanks, Luca