-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhowto.txt
187 lines (129 loc) · 7.44 KB
/
howto.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
###############################################################################
QUICK START AFTER CLONE
###############################################################################
./make.sh download
[1]--> ./make.sh busybox
./make.sh qemu-test iso
./make.sh clean image 8GB qemu 8GB ssh
[1] This target do not compile anymore busybox but expand an pre-saved archive.
However, you can decide to compile the busybox following the instructions
in the following list at point 16 but then you should do into a TC system.
IN FACT,
if your system libraries are incompatible with those included into TinyCore
the virtual machine will fail to boot. In such a case remove the rootfs.gz
and repeat the sequence from the start without busybox start. Then you can
create a rootfs.gz including the customised busybox enabling develop git
in tincore.conf and using the virtual machine for the building.
###############################################################################
DEAL WITH POSSIBLE PROBLES
###############################################################################
0. Enabling the qemu virtual network might lead to a conditions in which the
internet name resolution would not work anymore but the solution is quite
simple to solve and to check:
ping www.google.com
./make.sh qemu-init
ping www.google.com
if the 2nd ping fails then you should explicely add 8.8.8.8 as DNS in your
network connection. You can do this in three ways depending how is your
system is configured. First of all check if this package is installed:
apt list | grep resolvconf
if is installed then you can add the new DNS address to /etc/resolv.conf.
Otherwise you can use the graphical network manager to add the DNS to your
connection (the one that give the system the internet access). If you are
not using the network manager then you should add the DNS to your network
plan. Follow this link if you need more support.
https://linuxize.com/post/how-to-set-dns-nameservers-on-ubuntu-18-04/
###############################################################################
HOW TO DEAL WITH THE SUITE
###############################################################################
This is a suite for quickly editing and testing a USB bootable disk based on
TinyCore Linux. It makes use of qemu and it should be installed in advance.
USB firt partition label: T1NYC0R3 (but you can change it in rcS)
0. Please read copyright.txt for the license terms
1. Download the TinyCore 12.0 x86 64 bit components:
tinycore/provides/tcgetdistro.sh
2. Create the TinyCore 12.0 tcz package database:
tinycore/provides/tcupdatedb.sh
3. Everytime you modify the tinycore/changes/rcS rebuild the tinycore/rootfs.gz:
cd tinycore && ./rootfs.sh update && cd ..
4. Everytime you need to add a component, for example bin/tar, then do this:
cd tinycore/tcz
../provides/tcprovides.sh bin/tar
../provides/tcdownload.sh tar.tcz
cd -
if you like the new TCZs stay into your distro add them to tinycore/tinycore.conf
5. You can launch a qemu test with a simple image with this command:
./make.sh clean; ./make.sh qemu-test
6. You can launch a qemu test with a full image with this command:
./make.sh clean; ./make.sh qemu-test 8GB
7. In case you want generate a new USB disk image, do this:
./make.sh clean; ./make.sh image && ./make.sh close
8. To create your own real bootable USB disk, you can use this commands:
on windows: use rufus.exe with tcl-usb.disk.gz
on linux : zcat with tcl-usb.disk.gz > $device
At the first boot, it will create a secondary NTFS partition as large
as the entire USB disk space left free (USB disk size less 64 MB)
9. --- deleted ---
10. To explore all make.sh features call it without any parameter.
11. To access your customised TinyCore via SSH without password:
add you .pub key into sshkeys.pub
You can add into the USB disk folder or into the editor folder
depending if you want that every future distro have it or not.
12. To modify the USB disk with your custom changes:
cd tinycore; mkdir tmp
tar xvzf tccustom.tgz -C tmp
# make the changes you like
cd tmp; tar cvzf ../tccustom.tgz .
cd ..; rm -rf tmp
All these changes will be applied to the rootfs without permission time
and user preferences (tar uses -mo option) after the all TCZs loading.
Obviously, you have to recreate the image to apply the changes.
13. To update a qemu running instance or any machine connected to network:
./make.sh ssh-copy # for qemu running instance
./make.sh ssh-copy $ipaddr # for a connected machine
14. The customised TinyCore is able to install an Ubuntu on a machine.
Enter in ubuntu folder and follow the instruction to build system.tgz
then copy system.tgz, bootrd.gz and an update.tgz (if you like to
cutomise the Ubuntu installation) into the NTFS partition.
Boot with USB disk on the machine you like to install and type
system-install.sh # for the help
Pay attention to this command because wrong use might destroy data.
Please, test how it works in a empty virtual machine before using.
15. Edit syslinux.cfg for changing the default keyboard and any other boot
options which is required or optimal for your system. When you reach the
definitive boot configuration edit the tinycore/changes/syslinux.cfg
16. It is possible to download and compile a specific version of busybox
In order to integrate busybox into root filesystem follow these steps:
busybox/busybox.sh download
busybox/busybox.sh all
Instead to edit the source and try the compiled new version do this after:
busybox/busybox.sh open [suid|nosuid]
busybox/busybox.sh editconfig
# change the source here
busybox/busybox.sh update
# test the new changes
busybox/busybox.sh saveconfig
busybox/busybox.sh close
The no|suid parameter let you choose if you want update in the rootfs.gz
the busybox binary or the busybox.suid binary which is root user suided
17. The following file contains the SSH host keys for the host:
tinycore/changes/sshdhostkeys.tgz
They are saved in PEM format to be compatible with dropbear. With these
file every instance will have the same host keys of the others. If this
is not what you want, simple delete that file. You can also change the
tarball content using host keys of your own choice.
18. There is an adavantage using the ISO/USB image with VirtualBox: at the
boot the shared folder named 'Shared' will be mounted in /mnt/sf_Shared
19. When you arrived to a configuration which satisfy your expectations, then
you can save many seconds at boot time using tczmetamerge.sh. It will
create a big meta package for each onion layer defined in tinycore.conf.
The meta packaged named 'test' will be not produced because usefull for
quick changes in packages configuration for testing. Every time you will
change the packages configuration (conf.d/*.lst), you will need to redo
all meta packages and this is time consuming.
20. The USB image written on a USB key will create a secondary partition as
large as the USB at the first boot. This partition will be formatted in
NTFS if sshonly, usbkey meta packages are choosen and in EXT4 if the
develop package is inserted in the list. This allows you to use the USB
key as a rescue/maintanance/storage usbkey or using it as a developing
system in which you can compile directly on the EXT4 secondary partition.